home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume25 / trn / part12 < prev    next >
Encoding:
Internet Message Format  |  1991-12-02  |  72.0 KB

  1. Subject:  v25i015:  trn 2.0 - threaded newsreader based on rn 4.4, Part12/13
  2. Newsgroups: comp.sources.unix
  3. Approved: vixie@pa.dec.com
  4.  
  5. Submitted-by: davison@borland.com (Wayne Davison)
  6. Posting-number: Volume 25, Issue 15
  7. Archive-name: trn/part12
  8.  
  9. #! /bin/sh
  10. # This is a shell archive.  Remove anything before this line, then unpack
  11. # it by saving it into a file and typing "sh file".  To overwrite existing
  12. # files, type "sh file -c".  You can also feed this as standard input via
  13. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  14. # will see the following message at the end:
  15. #        "End of archive 12 (of 13)."
  16. # Contents:  Configure
  17. # Wrapped by vixie@cognition.pa.dec.com on Tue Dec  3 16:34:57 1991
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'Configure' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'Configure'\"
  21. else
  22. echo shar: Extracting \"'Configure'\" \(69963 characters\)
  23. sed "s/^X//" >'Configure' <<'END_OF_FILE'
  24. X#!/bin/sh
  25. X#
  26. X# This software is Copyright 1991 by Stan Barber. 
  27. X#
  28. X# Permission is hereby granted to copy, reproduce, redistribute or otherwise
  29. X# use this software as long as: there is no monetary profit gained
  30. X# specifically from the use or reproduction of this software, it is not
  31. X# sold, rented, traded or otherwise marketed, and this copyright notice is
  32. X# included prominently in any copy made. 
  33. X#
  34. X# The author make no claims as to the fitness or correctness of this software
  35. X# for any use whatsoever, and it is provided as is. Any use of this software
  36. X# is at the user's own risk. 
  37. X#
  38. X# If these # comments don't work, trim them.  Don't worry about the other
  39. X# shell scripts, Configure will trim # comments from them for you.
  40. X#
  41. X# $Id: Configure,v 4.4.3.1 1991/11/22 04:11:10 davison Trn $
  42. X#
  43. X# $Log: Configure,v $
  44. X# Revision 4.4.3.1  1991/11/22  04:11:10  davison
  45. X# Trn Release 2.0
  46. X# 
  47. X# Revision 4.4.2.1  1991/12/01  18:05:42  sob
  48. X# Patchlevel 2 changes
  49. X#
  50. X# Revision 4.4.1.1  1991/09/25  19:38:08  sob
  51. X# various fixed
  52. X#
  53. X# Revision 4.4  1991/09/09  20:18:23  sob
  54. X# release 4.4
  55. X#
  56. X#
  57. X
  58. X# Yes, you may rip this off to use in other distribution packages.
  59. X
  60. CTRLA=`echo a | tr a '\001'`
  61. X
  62. bopt=''
  63. n=''
  64. c=''
  65. libc=''
  66. sharedclib=''
  67. eunicefix=''
  68. eunice=''
  69. cpp=''
  70. shsharp=''
  71. spitshell=''
  72. startsh=''
  73. test=''
  74. expr=''
  75. sed=''
  76. echo=''
  77. cat=''
  78. rm=''
  79. mv=''
  80. cp=''
  81. tail=''
  82. tr=''
  83. mkdir=''
  84. sort=''
  85. uniq=''
  86. inews=''
  87. grep=''
  88. egrep=''
  89. nidump=''
  90. ypmatch=''
  91. contains=''
  92. lib=''
  93. nametype=''
  94. cc=''
  95. cflags=''
  96. iandd=''
  97. rrninclude=''
  98. termlib=''
  99. jobslib=''
  100. ndirlib=''
  101. socketlib=''
  102. dirtype=''
  103. dirinc=''
  104. libndir=''
  105. usendir=''
  106. ndirc=''
  107. ndiro=''
  108. posix=''
  109. pager=''
  110. mailer=''
  111. internet=''
  112. rnbin=''
  113. filexp=''
  114. distlist=''
  115. Log=''
  116. Id=''
  117. sitename=''
  118. hostfile=''
  119. domain=''
  120. orgname=''
  121. isadmin=''
  122. newsadmin=''
  123. rnlib=''
  124. mtlib=''
  125. mansrc=''
  126. manext=''
  127. maildir=''
  128. spool=''
  129. serverspool=''
  130. active=''
  131. myactive=''
  132. activetimes=''
  133. mininact=''
  134. pref=''
  135. defeditor=''
  136. rootid=''
  137. mboxchar=''
  138. locpref=''
  139. orgpref=''
  140. citypref=''
  141. statepref=''
  142. cntrypref=''
  143. contpref=''
  144. strchr=''
  145. memcpy=''
  146. rename=''
  147. ftruncate=''
  148. usleep=''
  149. uselect=''
  150. strftime=''
  151. xnxlib=''
  152. chsize=''
  153. tzset=''
  154. threaddef=''
  155. selectdef=''
  156. threaddir=''
  157. syslog=''
  158. novoid=''
  159. novfork=''
  160. sunos4=''
  161. portable=''
  162. passnam=''
  163. berknam=''
  164. usgnam=''
  165. whoami=''
  166. termio=''
  167. termios=''
  168. fcntl=''
  169. ioctl=''
  170. ptem=''
  171. normsig=''
  172. sigblock=''
  173. sigret=''
  174. sighold=''
  175. getuidgid=''
  176. setvbuf=''
  177. setbuffer=''
  178. getcwd=''
  179. getwd=''
  180. havetlib=''
  181. getpwent=''
  182. gethostname=''
  183. douname=''
  184. phostname=''
  185. hostcmd=''
  186. norelay=''
  187. isrrn=''
  188. xthread=''
  189. rdchk=''
  190. serverfile=''
  191. ignoreorg=''
  192. NNTPSRC=''
  193. CONFIG=''
  194. X
  195. echo "Beginning of configuration questions for trn."
  196. X: Eunice requires " " instead of "", can you believe it
  197. echo " "
  198. X
  199. X: sanity checks
  200. PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/bsd'
  201. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  202. X
  203. if test ! -t 0; then
  204. X    echo "Type 'sh Configure', not 'sh <Configure'"
  205. X    exit 1
  206. fi
  207. X
  208. X(alias) >/dev/null 2>&1 && \
  209. X    echo "(I see you are using the Korn shell.  Some ksh's blow up on Configure," && \
  210. X    echo "especially on exotic machines.  If yours does, try the Bourne shell instead.)"
  211. X
  212. X
  213. X: some greps do not return status, grrr.
  214. echo "grimblepritz" >grimble
  215. if grep blurfldyick grimble >/dev/null 2>&1 ; then
  216. X    contains=contains
  217. else
  218. X    if grep grimblepritz grimble >/dev/null 2>&1 ; then
  219. X    contains=grep
  220. X    else
  221. X    contains=contains
  222. X    fi
  223. fi
  224. X
  225. X: the following should work in any shell
  226. case $contains in
  227. contains*)
  228. X    echo " "
  229. X    echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  230. X    cat >contains <<'EOSS'
  231. grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  232. XEOSS
  233. chmod +x contains
  234. esac
  235. X
  236. X: first determine how to suppress newline on echo command
  237. echo "Checking echo to see how to suppress newlines..."
  238. X(echo "hi there\c" ; echo " ") >.echotmp
  239. if $contains c .echotmp >/dev/null 2>&1 ; then
  240. X    echo "...using -n."
  241. X    n='-n'
  242. X    c=''
  243. else
  244. X    cat <<'EOM'
  245. X...using \c
  246. XEOM
  247. X    n=''
  248. X    c='\c'
  249. fi
  250. echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
  251. read ans
  252. rm .echotmp
  253. X
  254. X: now set up to do reads with possible shell escape
  255. X: if this does not work on your machine, 1,$s/. myread/read ans/
  256. cat <<EOSC >myread
  257. ans='!'
  258. while expr "X\$ans" : "X!" >/dev/null; do
  259. X    read ans
  260. X    case "\$ans" in
  261. X    !)
  262. X    sh
  263. X    echo " "
  264. X    echo $n "Your answer: $c"
  265. X    ;;
  266. X    !*)
  267. X    set \`expr "X\$ans" : "X!\(.*\)\$"\`
  268. X    sh -c "\$*"
  269. X    echo " "
  270. X    echo $n "Your answer: $c"
  271. X    ;;
  272. X    esac
  273. done
  274. XEOSC
  275. X
  276. X: general instructions
  277. cat <<'EOH'
  278. This installation shell script will examine your system and ask you questions
  279. to determine how trn and its auxiliary files should be installed.  If you
  280. get stuck on a question, you may use a ! shell escape to start a subshell or
  281. execute a command.  Many of the questions will have default answers in
  282. square brackets--typing carriage return will give you the default.
  283. X
  284. On some of the questions which ask for file or directory names you are
  285. allowed to use the ~name construct to specify the login directory belonging
  286. to "name", even if you don't have a shell which knows about that.  Questions
  287. where this is allowed will be marked "(~name ok)".
  288. X
  289. Much effort has been expended to ensure that this shell script will run
  290. on any Unix system.  If despite that it blows up on you, your best bet is to
  291. edit Configure and run it again.  (Trying to install trn without having run
  292. Configure is well nigh impossible.)  Also, tell Wayne Davison how he blew it
  293. X(davison@borland.com).
  294. X
  295. This installation script affects things by doing direct variable substitutions
  296. on some of the files included in this kit. You may edit any of these files as
  297. the need arises after running this script.
  298. X
  299. XEOH
  300. echo $n "[Type carriage return to continue] $c"
  301. X. myread
  302. XXn=$n
  303. XXc=$c
  304. X: get old answers, if there is a config file out there
  305. if test -f ./config.sh; then
  306. X    echo " "
  307. X    dflt=y
  308. X    rp="I see a config.sh file.  Do you want to use it to set the defaults? [$dflt]"
  309. X    echo $n "$rp $c"
  310. X    . myread
  311. X    case "$ans" in
  312. X    n*) echo "OK, I'll ignore it.";;
  313. X    *)  echo "Fetching default answers from your old config.sh file..."
  314. X    tmp="$n"
  315. X    ans="$c"
  316. X        . ./config.sh
  317. X    n="$tmp"
  318. X    c="$ans"
  319. X    ;;
  320. X    esac
  321. fi
  322. X
  323. n=$Xn
  324. c=$Xc
  325. X
  326. X: get list of predefined functions in a handy place
  327. echo " "
  328. if test -f /lib/libc.a; then
  329. X    if test -f /usr/lib/libc.a ; then
  330. X    echo "Found two C libraries:  /lib/libc.a and /usr/lib/libc.a"
  331. X    if test -d /usr/convex ; then
  332. X        echo "Ah!  This is ConvexOS!  We'll use the one in /usr/lib."
  333. X        libc=/usr/lib/libc.a
  334. X    else
  335. X        echo "Hmmm...we'll use the more normal of the two:  /lib/libc.a"
  336. X        libc=/lib/libc.a
  337. X    fi
  338. X    else
  339. X    echo "Your C library is in /lib/libc.a.  You're normal."
  340. X    if test -f /lib/libc_s.a; then
  341. X        echo "You also have AT&T shared libraries, we'll use those."
  342. X        sharedclib=-lc_s
  343. X    fi
  344. X    libc=/lib/libc.a
  345. X    fi
  346. else
  347. X  if test -f /lib/libc; then
  348. X    echo "Your C library is in /lib/libc.  This might be Domain/OS."
  349. X    libc=/lib/libc
  350. X  else
  351. X    if test -f /lib/Llibc.a; then
  352. X    echo "Your C library is in /lib/Llibc.a.  I smell Xenix!"
  353. X    libc=/lib/Llibc.a
  354. X    else
  355. X    if test -f /usr/lib/libc.a; then
  356. X        echo "Your C library is in /usr/lib/libc.a, of all places."
  357. X        libc=/usr/lib/libc.a
  358. X        if test -f /usr/lib/libc_s.a; then
  359. X        echo "You also have AT&T shared libraries, we'll use those."
  360. X        sharedclib=-lc_s
  361. X        fi
  362. X    else
  363. X        if test -f /lib/clib; then
  364. X        echo "Your C library is in /lib/clib.  How nonstandard, must be Apollo."
  365. X        libc=/lib/clib
  366. X        else
  367. X        if test -f "$libc"; then
  368. X            echo "Your C library is in $libc, like you said before."
  369. X        else
  370. X            cat <<'EOM'
  371. I can't seem to find your C library.  I've looked for /lib/libc.a and
  372. X/usr/lib/libc.a, but neither of those are there. Perhaps you can find
  373. out by reading `man 3 intro' if you have the 'man' facility installed.
  374. X
  375. XEOM
  376. X            echo $n "What is the full name of your C library? $c"
  377. X            . myread
  378. X            libc="$ans"
  379. X        fi
  380. X        fi
  381. X    fi
  382. X    fi
  383. X  fi
  384. fi
  385. X
  386. if test -d /usr/bsd43 -o -d /usr/bsd ; then
  387. X    echo " "
  388. X    echo "It appears that you might be running on a RISC/os box."
  389. X    echo $n "Should I pass the -B option to nm [y]? $c"
  390. X    . myread
  391. X    case $ans in
  392. X    n*|f*) bopt=''   ;;
  393. X    *)     bopt='-B' ;;
  394. X    esac
  395. fi
  396. if test -f /bin/smit ; then
  397. X    echo " "
  398. X    echo "It appears that you might be running on an IBM RS/6000 box."
  399. X    echo "We'll be using 'nm -B' to get the symbol lists."
  400. X    bopt='-B'
  401. fi
  402. X
  403. echo " "
  404. echo $n "Extracting names from $libc for later perusal...$c"
  405. nm $bopt $libc > nm.list 2>/dev/null
  406. sed -n -e 's/^.* T _//p' -e 's/^.* T //p' < nm.list > libc.list
  407. if $contains '^printf$' libc.list >/dev/null 2>&1; then
  408. X    echo "done"
  409. else
  410. X    sed -n -e 's/^.* D _//p' -e 's/^.* D //p' < nm.list > libc.list
  411. X    if $contains '^printf$' libc.list >/dev/null 2>&1; then
  412. X    echo "done"
  413. X    else
  414. X     $contains .text nm.list | grep -v static | awk '{ print $1 }' > libc.list
  415. X        if $contains '^printf$' libc.list >/dev/null 2>&1; then
  416. X        echo "done"
  417. X        else
  418. X         echo " "
  419. X         echo "nm didn't seem to work right."
  420. X         echo "Trying ar instead..."
  421. X         if ar t $libc | sed -e 's/\.o$//' > libc.list; then
  422. X        echo "Ok."
  423. X         else
  424. X        echo "That didn't work either.  Giving up."
  425. X        exit 1
  426. X         fi
  427. X     fi
  428. X    fi
  429. fi
  430. rm nm.list
  431. X: make some quick guesses about what we are up against
  432. echo " "
  433. echo $n "Hmm...  $c"
  434. if $contains '^sigvec$' libc.list >/dev/null 2>&1 ; then
  435. X    echo "Looks kind of like a BSD system, but we'll see..."
  436. X    echo exit 0 >bsd
  437. X    echo exit 1 >usg
  438. X    echo exit 1 >v7
  439. else
  440. X    if $contains '^dup2$' libc.list >/dev/null 2>&1 ; then
  441. X    echo "Looks sort of like a V7 system, but we'll see..."
  442. X    echo exit 1 >bsd
  443. X    echo exit 1 >usg
  444. X    echo exit 0 >v7
  445. X    else
  446. X        echo "Looks kind of like a USG system, but we'll see..."
  447. X        echo exit 1 >bsd
  448. X        echo exit 0 >usg
  449. X        echo exit 1 >v7
  450. X    fi
  451. fi
  452. X:
  453. if test -f /etc/inittab; then
  454. X    echo "You have an inittab file. You must be a USG system!"
  455. X    echo exit 1 >bsd
  456. X    echo exit 0 >usg
  457. X    echo exit 1 >v7
  458. fi
  459. if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
  460. X    cat <<'EOI'
  461. There is, however, a strange, musty smell in the air that reminds me of
  462. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  463. XEOI
  464. X    echo "exit 0" >eunice
  465. X    eunicefix=unixtovms
  466. X    eunice=define
  467. X: it so happens the Eunice I know will not run shell scripts in Unix format
  468. else
  469. X    echo " "
  470. X    echo "Congratulations.  You aren't running Eunice."
  471. X    eunicefix=':'
  472. X    eunice=undef
  473. X    echo "exit 1" >eunice
  474. fi
  475. chmod +x bsd usg v7 eunice
  476. X$eunicefix bsd usg v7 eunice
  477. X: see how we invoke the C preprocessor
  478. echo " "
  479. echo "Checking to see how your C preprocessor is invoked..."
  480. cat <<'EOT' >testcpp.c
  481. X#define ABC abc
  482. X#define XYZ xyz
  483. ABC+XYZ
  484. XEOT
  485. echo 'Maybe "cc -E" will work...'
  486. cc -E testcpp.c >testcpp.out 2>&1
  487. if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  488. X    echo "Yup, it does."
  489. X    cpp='cc -E'
  490. else
  491. X    echo 'Nope...maybe "cc -P" will work...'
  492. X    cc -P testcpp.c >testcpp.out 2>&1
  493. X    if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  494. X    echo "Yup, that does."
  495. X    cpp='cc -P'
  496. X    else
  497. X    echo 'Nixed again...maybe "/lib/cpp" will work...'
  498. X    /lib/cpp testcpp.c >testcpp.out 2>&1
  499. X    if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  500. X        echo "Hooray, it works!  I was beginning to wonder."
  501. X        cpp='/lib/cpp'
  502. X    else
  503. X        if $contains 'abc +xyz' testcpp.out >/dev/null 2>&1 ; then
  504. X        echo "Found it!  You're on a NeXT, aren't you?"
  505. X        cpp='/lib/cpp'
  506. X        else
  507. X        echo 'Hmm...maybe you already told me...'
  508. X        case "$cpp" in
  509. X        '') ;;
  510. X        *) $cpp testcpp.c >testcpp.out 2>&1;;
  511. X        esac
  512. X        if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  513. X            echo "Hooray, you did!  I was beginning to wonder."
  514. X        else
  515. X            echo "Nope. I can't find a C preprocessor.  Name one: $c"
  516. X            . myread
  517. X            cpp="$ans"
  518. X            $cpp testcpp.c >testcpp.out 2>&1
  519. X            if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  520. X            echo "OK, that will do."
  521. X            else
  522. X            echo "Sorry, I can't get that to work.  Go find one."
  523. X            exit 1
  524. X            fi
  525. X        fi
  526. X        fi
  527. X    fi
  528. X    fi
  529. fi
  530. rm -f testcpp.c testcpp.out
  531. X: check for pdp11
  532. echo " "
  533. cat <<'EOT' >pdp11.c
  534. X#ifdef pdp11
  535. exit 0
  536. X#else
  537. exit 1
  538. X#endif
  539. XEOT
  540. X$cpp pdp11.c | grep exit >pdp11
  541. chmod +x pdp11
  542. X$eunicefix pdp11
  543. rm pdp11.c
  544. if pdp11; then
  545. X    echo "This looks like a pdp11 to me."
  546. fi
  547. X: check for ultrix
  548. cat <<'EOT' >ultrix.c
  549. X#ifdef ultrix
  550. exit 0
  551. X#else
  552. exit 1
  553. X#endif
  554. XEOT
  555. X$cpp ultrix.c | grep exit >ultrix
  556. chmod +x ultrix
  557. X$eunicefix ultrix
  558. rm ultrix.c
  559. if ultrix; then
  560. X    echo "Running ultrix, eh?"
  561. fi
  562. X
  563. X: check for uts
  564. cat <<'EOT' >uts.c
  565. X#ifdef uts
  566. exit 0
  567. X#else
  568. exit 1
  569. X#endif
  570. XEOT
  571. X$cpp uts.c | grep exit >uts
  572. chmod +x uts
  573. X$eunicefix uts
  574. rm uts.c
  575. if uts; then
  576. X    echo "This appears to be some kind of System370-type system running UTS."
  577. X    socketlib=-lsocket
  578. fi
  579. X
  580. X: check for sun 4.0
  581. sunos4=undef
  582. cat <<'EOT' >sun.c
  583. X#ifdef sun
  584. exit 0
  585. X#else
  586. exit 1
  587. X#endif
  588. XEOT
  589. X$cpp sun.c | grep exit >sun
  590. chmod +x sun
  591. X$eunicefix sun
  592. rm sun.c
  593. if sun; then
  594. X    echo "This looks like a sun to me."
  595. X    if test -f /etc/ld.so.cache ; then
  596. X    echo "And it appears you are running SunOS 4.0 or greater."
  597. X        sunos4=define
  598. X    socketlib=
  599. X    rrninclude=
  600. X     fi
  601. fi
  602. X: check for hp-ux
  603. cat <<'EOT' >hp-ux.c
  604. X#ifdef hpux
  605. exit 0
  606. X#else
  607. exit 1
  608. X#endif
  609. XEOT
  610. X$cpp hp-ux.c | grep exit >hp-ux
  611. chmod +x hp-ux
  612. X$eunicefix hp-ux
  613. rm hp-ux.c
  614. if hp-ux; then
  615. X    echo "Hewlett-Packard must have built this..."
  616. X    socketlib=-lbsdipc
  617. fi
  618. X
  619. X: check for mips
  620. cat <<'EOT' >mips.c
  621. X#if defined(mips) && !defined(ultrix)
  622. exit 0
  623. X#else
  624. exit 1
  625. X#endif
  626. XEOT
  627. X$cpp mips.c | grep exit >mips
  628. chmod +x mips
  629. X$eunicefix mips
  630. rm mips.c
  631. if mips; then
  632. X    echo "Looks like mips RISC/os..."
  633. X    rrninclude="-DUSG -I/usr/include/bsd"
  634. X    socketlib=-lbsd
  635. fi
  636. X: check for stardent
  637. cat <<'EOT' >stardent.c
  638. X#if defined(stardent) || defined(ardent) || defined (steller)
  639. exit 0
  640. X#else
  641. exit 1
  642. X#endif
  643. XEOT
  644. X$cpp stardent.c | grep exit >stardent
  645. chmod +x stardent
  646. X$eunicefix stardent
  647. rm stardent.c
  648. if stardent; then
  649. X    echo "This appears to be a Stardent/Steller/Ardent..."
  650. X    rrninclude="-DUSG"
  651. X    socketlib=
  652. fi
  653. X: check for sgi
  654. cat <<'EOT' >sgi.c
  655. X#ifdef sgi
  656. exit 0
  657. X#else
  658. exit 1
  659. X#endif
  660. XEOT
  661. X$cpp sgi.c | grep exit >sgi
  662. chmod +x sgi
  663. X$eunicefix sgi
  664. rm sgi.c
  665. if sgi; then
  666. X    echo "Silicon Graphics must have built this..."
  667. X    if test -f /usr/lib/libsun.a ; then
  668. X        socketlib=-lsun
  669. X    fi
  670. fi
  671. X
  672. X: check for XENIX
  673. cat <<'EOT' >xenix
  674. test -f /xenix; exit $?
  675. XEOT
  676. chmod +x xenix
  677. X$eunicefix xenix
  678. if xenix; then
  679. X    echo "Kinda looks like XENIX....hmmm"
  680. X    rrninclude="-DUSG -DLAI_TCP"
  681. X    socketlib=-lsocket
  682. X    rdchk=define
  683. X    dirtype=dirent
  684. X    dirinc="<dirent.h>"
  685. else
  686. X    rdchk=undef
  687. fi
  688. X
  689. X: check for Pyramid OSx
  690. cat <<'EOT' >pyr.c
  691. X#ifdef pyr
  692. exit 0
  693. X#else
  694. exit 1
  695. X#endif
  696. XEOT
  697. X$cpp pyr.c | grep exit >pyr
  698. chmod +x pyr
  699. X$eunicefix pyr
  700. rm pyr.c
  701. if pyr; then
  702. X    echo "This looks like a Pyramid to me."
  703. fi
  704. X
  705. X: check for NeXT
  706. cat <<'EOT' >next.c
  707. X#ifdef NeXT
  708. exit 0
  709. X#else
  710. exit 1
  711. X#endif
  712. XEOT
  713. X$cpp next.c | grep exit >next
  714. chmod +x next
  715. X$eunicefix next
  716. rm next.c
  717. if next; then
  718. X    echo "My, you really ARE on a NeXT."
  719. X    addcflags=' -bsd'
  720. X    test=test
  721. else
  722. X    addcflags=''
  723. fi
  724. X
  725. if bsd; then
  726. X    getuidgid=define
  727. else
  728. X    getuidgid=undef
  729. fi
  730. X
  731. cat <<'EOT' > s5uniq
  732. if test -f /bin/uname
  733. then
  734. X    case `uname -r -m` in
  735. X    "5.3 vax-"*)
  736. X        if [ -f /usr/lib/libnet.a \
  737. X          -a -f /usr/lib/libhdb.a \
  738. X          -a -f /usr/lib/libbbn.a \
  739. X          -a -f /usr/lib/libstr.a ]
  740. X        then
  741. X            exit 0
  742. X        fi;;
  743. X    esac
  744. fi
  745. exit 1
  746. XEOT
  747. chmod +x s5uniq
  748. if s5uniq; then
  749. X    echo "This looks like Uniq.  What a pity."
  750. X    socketlib="-lnet -lhdb -lbbn -lstr"
  751. X    rrninclude="-DR_UNIQ -DUSG"
  752. X    # -DR_UNIQ and -DUSG are needed for ~nntp/common/clientlib.c
  753. fi
  754. X: check for posix
  755. posix=''
  756. if usg; then
  757. X    if test -f /lib/libcposix.a; then
  758. X    echo "Your version of System V supports POSIX compatibility."
  759. X    echo "We'll make use of it!"
  760. X    posix=' -Xp'
  761. X    fi
  762. fi
  763. X
  764. X
  765. X: see if sh knows # comments
  766. echo " "
  767. echo "Checking your sh to see if it knows about # comments..."
  768. if sh -c '#' >/dev/null 2>&1 ; then
  769. X    echo "Your sh handles # comments correctly."
  770. X    shsharp=true
  771. X    spitshell=cat
  772. X    echo " "
  773. X    echo "Okay, let's see if #! works on this system..."
  774. X    echo "#!/bin/echo hi" > try
  775. X    $eunicefix try
  776. X    chmod +x try
  777. X    try > today
  778. X    if test -s today; then
  779. X    echo "It does."
  780. X    sharpbang='#!'
  781. X    else
  782. X    echo "#! /bin/echo hi" > try
  783. X    $eunicefix try
  784. X    chmod +x try
  785. X    try > today
  786. X    if test -s today; then
  787. X        echo "It does."
  788. X        sharpbang='#! '
  789. X    else
  790. X        echo "It doesn't."
  791. X        sharpbang=': use '
  792. X    fi
  793. X    fi
  794. else
  795. X    echo "Your sh doesn't grok # comments--I will strip them later on."
  796. X    shsharp=false
  797. X    echo "exec grep -v '^#'" >spitshell
  798. X    chmod +x spitshell
  799. X    $eunicefix spitshell
  800. X    spitshell=`pwd`/spitshell
  801. X    echo "I presume that if # doesn't work, #! won't work either!"
  802. X    sharpbang=': use '
  803. fi
  804. X
  805. X: figure out how to guarantee sh startup
  806. echo " "
  807. echo "Checking out how to guarantee sh startup..."
  808. startsh=$sharpbang'/bin/sh'
  809. echo "Let's see if '$startsh' works..."
  810. cat >try <<EOSS
  811. X$startsh
  812. set abc
  813. test "$?abc" != 1
  814. XEOSS
  815. X
  816. chmod +x try
  817. X$eunicefix try
  818. if try; then
  819. X    echo "Yup, it does."
  820. else
  821. X    echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  822. fi
  823. rm -f try today
  824. X
  825. X: find out where common programs are
  826. echo " "
  827. echo "Locating common programs..."
  828. pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /usr/etc /usr/5bin /usr/bsd /usr/bsd43"
  829. cat <<EOSC >loc
  830. X$startsh
  831. thing=\$1
  832. shift
  833. dflt=\$1
  834. shift
  835. for dir in \$*; do
  836. X    case "\$thing" in
  837. X    .)
  838. X    if test -d \$dir/\$thing; then
  839. X        echo \$dir
  840. X        exit 0
  841. X    fi
  842. X    ;;
  843. X    *)
  844. X    if test -f \$dir/\$thing; then
  845. X        echo \$dir/\$thing
  846. X        exit 0
  847. X    fi
  848. X    ;;
  849. X    esac
  850. done
  851. echo \$dflt
  852. exit 1
  853. XEOSC
  854. chmod +x loc
  855. X$eunicefix loc
  856. loclist="expr sed echo cat rm mv cp tail tr mkdir sort uniq grep"
  857. trylist="test inews egrep more pg Mcc nidump ypmatch"
  858. for file in $loclist; do
  859. X    xxx=`loc $file $file $pth`
  860. X    eval $file=$xxx
  861. X    case "$xxx" in
  862. X    /*)
  863. X    echo $file is in $xxx.
  864. X    ;;
  865. X    *)
  866. X    echo "I don't know where $file is.  I hope it's in everyone's PATH."
  867. X    ;;
  868. X    esac
  869. done
  870. echo " "
  871. echo "Don't worry if any of the following aren't found..."
  872. for file in $trylist; do
  873. X    xxx=`loc $file $file $pth`
  874. X    eval $file=$xxx
  875. X    case "$xxx" in
  876. X    /*)
  877. X    echo $file is in $xxx.
  878. X    ;;
  879. X    *)
  880. X    echo "I don't see $file out there, offhand."
  881. X    ;;
  882. X    esac
  883. done
  884. case $egrep in
  885. egrep)
  886. X    echo "Substituting grep for egrep."
  887. X    egrep=$grep
  888. X    ;;
  889. esac
  890. case $test in
  891. test)
  892. X    echo "Hopefully test is built into your sh."
  893. X    ;;
  894. X/bin/test)
  895. X    echo " "
  896. X    echo $n 'Is your "test" built into sh? [n] (OK to guess) '"$c"
  897. X    . myread
  898. X    case $ans in
  899. X    y*) test=test ;;
  900. X    esac
  901. X    ;;
  902. X*)
  903. X    test=test
  904. X    ;;
  905. esac
  906. case $echo in
  907. echo)
  908. X    echo "Hopefully echo is built into your sh."
  909. X    ;;
  910. X/bin/echo)
  911. X    echo " "
  912. X    echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
  913. X    $echo $n "hi there$c" >foo1
  914. X    echo $n "hi there$c" >foo2
  915. X    if cmp foo1 foo2 >/dev/null 2>&1; then
  916. X    echo "They are compatible.  In fact, they may be identical."
  917. X    else
  918. X    echo "They are not compatible--the echo builtin will be used."
  919. X    echo=echo
  920. X    fi
  921. X    $rm -f foo1 foo2
  922. X    ;;
  923. X*)
  924. X    echo=echo
  925. X    ;;
  926. esac
  927. X$echo " "
  928. X: test yp
  929. case $ypmatch in
  930. ypmatch)
  931. X    $echo "I don't see ypmatch out there, so YP is not available. We'll search the"
  932. X    $echo "passwd file the old fashioned way!"
  933. X    ;;
  934. X*)
  935. X    $ypmatch 513/tcp services > /dev/null 2>/dev/null
  936. X    status=$?
  937. X    if $test $status  -ne 0 ; then
  938. X    $echo "YP installed, but not operational. We won't use it."
  939. X    ypmatch=""
  940. X    else
  941. X        $echo "YP installed and operational."
  942. X    fi
  943. X    
  944. X    ;;
  945. esac
  946. if $test "$nidump" = "nidump"; then
  947. X    nidump=""
  948. fi
  949. if $test "$ypmatch" = "ypmatch"; then
  950. X    ypmatch=""
  951. fi
  952. X: decide how portable to be
  953. case "$portable" in
  954. define) dflt=y;;
  955. X*)    dflt=n;;
  956. esac
  957. X$cat <<'EOH'
  958. I can set things up so that your shell scripts and binaries are more portable,
  959. at what may be a noticeable cost in performance.  In particular, if you
  960. ask to be portable, the following happens:
  961. X
  962. X     1) shell scripts will rely on the PATH variable rather than using
  963. X    the paths derived above.
  964. X     2) ~username interpretations will be done at run time rather than
  965. X    by Configure.
  966. X     3) the system name will be determined at run time, if at all possible.
  967. X
  968. XEOH
  969. X$echo $n "Do you expect to run these scripts and binaries on multiple machines? [$dflt] $c"
  970. X. myread
  971. case $ans in
  972. X'') ans=$dflt;;
  973. esac
  974. case $ans in
  975. X    y*) portable=define
  976. X    for file in $loclist; do
  977. X        eval $file=$file
  978. X    done
  979. X    ;;
  980. X    *)  portable=undef ;;
  981. esac
  982. X
  983. X: set up shell script to do ~ expansion
  984. cat >filexp <<EOSS
  985. X$startsh
  986. X: expand filename
  987. case \$1 in
  988. X~/*|~)
  989. X    $echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  990. X    ;;
  991. X~*)
  992. X    if $test -f /bin/csh; then
  993. X    /bin/csh -f -c "glob \$1"
  994. X    $echo ""
  995. X    else
  996. X    name=\`$expr x\$1 : '..\([^/]*\)'\`
  997. X    if $test "$ypmatch" != ""; then
  998. X         dir=\`$ypmatch \$name passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/"'\`
  999. X    elif $test "$nidump" != ""; then
  1000. X        dir=\`$nidump passwd / | $sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
  1001. X    fi
  1002. X    if $test "\$dir" = ""; then
  1003. X        dir=\`$sed </etc/passwd -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
  1004. X    fi
  1005. X    if $test ! -d "\$dir"; then
  1006. X        me=\`basename \$0\`
  1007. X        $echo "\$me: can't locate home directory for: \$name" >&2
  1008. X        exit 1
  1009. X    fi
  1010. X    case \$1 in
  1011. X    */*)
  1012. X        $echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  1013. X        ;;
  1014. X    *)
  1015. X        $echo \$dir
  1016. X        ;;
  1017. X    esac
  1018. X    fi
  1019. X    ;;
  1020. X*)
  1021. X    $echo \$1
  1022. X    ;;
  1023. esac
  1024. XEOSS
  1025. chmod +x filexp
  1026. X$eunicefix filexp
  1027. X
  1028. X: try to deal with domains
  1029. X$cat << 'EOH'
  1030. X
  1031. Please enter your domain name.  This will be used in conjunction with the
  1032. site name for return addresses on news articles and mail.  If you use the
  1033. X4.3ism of having your domain in your hostname, all the posting programs
  1034. will figure this out on the fly, so don't worry.
  1035. X
  1036. XExamples of some valid domains:
  1037. X    berkeley.edu
  1038. X    nasa.gov
  1039. XExample of an invalid domain in common use:
  1040. X    uucp
  1041. XEOH
  1042. X
  1043. case "$domain" in
  1044. X'') dflt="uucp";;
  1045. X*)  dflt="$domain" ;;
  1046. esac
  1047. X$echo $n "Your domain: [$dflt] $c"
  1048. X. myread
  1049. case "$ans" in
  1050. X'') domain="$dflt";;
  1051. X*)  domain="$ans" ;;
  1052. esac
  1053. X
  1054. X: now get the site name
  1055. X$echo " "
  1056. X$echo "Figuring out site name..."
  1057. X$echo 'Maybe "hostname" will work...'
  1058. if ans=`sh -c hostname 2>&1` ; then
  1059. X    thissite=$ans
  1060. X    hostcmd=hostname
  1061. else
  1062. X    $echo 'No, maybe "uuname -l" will work...'
  1063. X    if ans=`sh -c 'uuname -l' 2>&1` ; then
  1064. X    thissite=$ans
  1065. X    hostcmd='uuname -l'
  1066. X    else
  1067. X    $echo 'Strange.  Maybe "uname -n" will work...'
  1068. X    if ans=`sh -c 'uname -n' 2>&1` ; then
  1069. X        thissite=$ans
  1070. X        hostcmd='uname -n'
  1071. X    else
  1072. X        $echo 'Oh well, maybe I can mine it out of whoami.h...'
  1073. X        if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  1074. X        thissite=`$echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  1075. X        hostcmd="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  1076. X        else
  1077. X        case "$sitename" in
  1078. X        '') $echo "Does this machine have an identity crisis or something?"
  1079. X            hostcmd=''
  1080. X            ;;
  1081. X        *)  $echo "Well, you said $sitename before..."
  1082. X            thissite="$sitename"
  1083. X            ;;
  1084. X        esac
  1085. X        fi
  1086. X    fi
  1087. X    fi
  1088. fi
  1089. X: you do not want to know about this
  1090. set $thissite
  1091. thissite=$1
  1092. X
  1093. X: translate upper to lower case. This is mostly to help UUCP work right.
  1094. case $thissite in
  1095. X    *[A-Z]*)
  1096. X    thissite=`$echo $thissite | tr '[A-Z]' '[a-z]'`
  1097. X    $echo "(Normalizing case in your site name)"
  1098. X    ;;
  1099. esac
  1100. X
  1101. X: verify site name and allow them to override it
  1102. if $test "$thissite" ; then
  1103. X    $echo 'Your site name appears to be "'$thissite'".'
  1104. else
  1105. X    thissite='unknown'
  1106. fi
  1107. case "$hostfile" in
  1108. X/*) dflt="$hostfile" ;;
  1109. X*)  case "$sitename" in
  1110. X    '') dflt="$thissite" ;;
  1111. X    *)  dflt="$sitename" ;;
  1112. X    esac
  1113. esac
  1114. X$cat <<'EOM'
  1115. X
  1116. In some cases it is not desirable to use the actual site name in your return
  1117. addresses (if, for example, all mail gets routed first to one site).  In this
  1118. case trn allows you to either hard-wire a site name or read the site name from
  1119. a file.  To indicate a file, start the name with a slash (e.g. /etc/sitename).
  1120. To use just your domain name, re-enter it here.  A period-less site name will
  1121. automatically get your domain name added to it.
  1122. X
  1123. XEOM
  1124. while $test $dflt ; do
  1125. X    $echo $n "What site name goes in return addresses? [$dflt] $c"
  1126. X    . myread 
  1127. X    case $ans in
  1128. X    '') ans=$dflt;;
  1129. X    esac
  1130. X    case $ans in
  1131. X    /*)
  1132. X    if $test -f $ans ; then
  1133. X        hostfile="$ans"
  1134. X        hostcmd="$cat $ans"
  1135. X        sitename=`$hostcmd`
  1136. X        $echo "Trn will read the site name from $ans:  $sitename."
  1137. X        dflt=''
  1138. X    else
  1139. X        $echo "Unable to locate $ans."
  1140. X    fi
  1141. X    ;;
  1142. X    *)  hostfile=''
  1143. X    if $test "X$thissite" = "X$ans" ; then
  1144. X        sitename="$thissite"
  1145. X        $echo "Using the site name derived by $hostcmd:  $sitename."
  1146. X    else
  1147. X        hostcmd=''
  1148. X        sitename="$ans"
  1149. X        $echo "Using a hard-wired site name:  $sitename."
  1150. X    fi
  1151. X    dflt=''
  1152. X    ;;
  1153. X    esac
  1154. done
  1155. X
  1156. if $test $portable = "undef" ; then
  1157. X    case $sitename in
  1158. X    *.*)    ;;
  1159. X    *)    sitename=$sitename.$domain
  1160. X        ;;
  1161. X    esac
  1162. fi
  1163. X
  1164. X: get organization name
  1165. longshots='/usr/src/new /usr/src/local /usr/local/src'
  1166. case "$orgname" in
  1167. X'') if xxx=`loc news/src/defs.h x $longshots`; then
  1168. X    dflt=`$sed -n 's/^.*MYORG[     ]*"\(.*\)".*$/\1/p' $xxx`
  1169. X    else
  1170. X    dflt='no default'
  1171. X    fi
  1172. X    ;;
  1173. X*)  dflt="$orgname";;
  1174. esac
  1175. X$cat << 'EOH'
  1176. Please type the name of your organization as you want it to appear on the
  1177. Organization line of outgoing articles.  (It's nice if this also specifies
  1178. your location.  Your city name is probably sufficient if well known.)
  1179. XFor example:
  1180. X
  1181. X    University of Southern North Dakota, Hoople
  1182. X
  1183. You may also put the name of a file, as long as it begins with a slash.
  1184. XFor example:
  1185. X
  1186. X    /etc/organization
  1187. X
  1188. XEOH
  1189. orgname="no default"
  1190. while test "X$orgname" = "Xno default"; do
  1191. X    $echo $n "Organization: [$dflt] $c"
  1192. X    . myread
  1193. X    case "$ans" in
  1194. X    '') orgname="$dflt";;
  1195. X    *)  orgname="$ans" ;;
  1196. X    esac
  1197. done
  1198. X
  1199. X: Decide whether to ignore the ORGANIZATION environment variable
  1200. cat <<'EOM'
  1201. X
  1202. Trn normally looks in the environment variables NEWSORG and ORGANIZATION
  1203. for an overriding organization name.  However, if your operating system
  1204. reserves the environment variable ORGANIZATION for non-News purposes,
  1205. you will want to ignore it and only have trn check for NEWSORG.
  1206. X
  1207. XEOM
  1208. X
  1209. case "$ignoreorg" in
  1210. define) dflt=y ;;
  1211. X*)      dflt=n ;;
  1212. esac
  1213. X$echo $n "Should we ignore ORGANIZATION? [$dflt] $c"
  1214. X. myread
  1215. case "$ans" in
  1216. X'') ans="$dflt";;
  1217. esac
  1218. case "$ans" in
  1219. y*) ignoreorg=define ;;
  1220. X*)  ignoreorg=undef ;;
  1221. esac
  1222. X
  1223. X: get news administrator name
  1224. case "$newsadmin" in
  1225. X'')
  1226. X    if $contains "^news:" /etc/passwd >/dev/null 2>&1 ; then
  1227. X    dflt=news
  1228. X    else
  1229. X    if $contains "^usenet:" /etc/passwd >/dev/null 2>&1 ; then
  1230. X        dflt=usenet
  1231. X    else
  1232. X        if eunice; then
  1233. X        dflt=system
  1234. X        else
  1235. X        dflt=root
  1236. X        fi
  1237. X    fi
  1238. X    fi
  1239. X    ;;
  1240. X*)  dflt="$newsadmin"
  1241. X    ;;
  1242. esac
  1243. cat <<'EOM'
  1244. Many systems keep their news in a private directory, or have a non-superuser
  1245. in charge of administering news.  (If you don't have such a user, take the
  1246. default answer.)  What is the login name (not directory) that is used for news
  1247. XEOM
  1248. X$echo $n "administration? [$dflt] $c"
  1249. X. myread
  1250. newsadmin="$ans"
  1251. case $newsadmin in
  1252. X'') newsadmin=$dflt ;;
  1253. esac
  1254. case $newsadmin in
  1255. root) isadmin=undef ;;
  1256. X*)    isadmin=define ;;
  1257. esac
  1258. X
  1259. X: figure out news library
  1260. case "$lib" in
  1261. X'')
  1262. X    dflt=/usr/lib/news
  1263. X    ;;
  1264. X*)  dflt=$lib ;;
  1265. esac
  1266. libexp=$lib
  1267. libexp='blurfl/dyick'
  1268. while $test ! -d "$libexp"; do
  1269. X    $echo " "
  1270. X    case "$libexp" in
  1271. X    blurfl*) ;;
  1272. X    *) $echo "Directory $libexp not found";;
  1273. X    esac
  1274. X    $echo $n "Where is your news library (~name okay)? [$dflt] $c"
  1275. X    . myread
  1276. X    case "$ans" in
  1277. X    '') ans="$dflt";;
  1278. X    esac
  1279. X    lib="$ans"
  1280. X    case $lib in
  1281. X    ~*)
  1282. X    libexp=`filexp $lib`
  1283. X    $echo "(That is $libexp on this particular system.)"
  1284. X    case $portable in
  1285. X      undef) lib=$libexp ;;
  1286. X    esac
  1287. X    ;;
  1288. X    *)
  1289. X    libexp=$lib
  1290. X    ;;
  1291. X    esac
  1292. done
  1293. X
  1294. X: locate the inews program
  1295. ans='no default'
  1296. while $test ! -f "$ans" ; do
  1297. X    case $ans in
  1298. X      'no default') ;;
  1299. X      *) $echo "$ans does not appear to exist." ;;
  1300. X    esac
  1301. X    case "$inews" in
  1302. X      ''|inews) 
  1303. X        if $test -f $libexp/inews; then
  1304. X          dflt=$libexp/inews
  1305. X        else
  1306. X            dflt='no default'
  1307. X        fi
  1308. X      ;;
  1309. X      *)  dflt="$inews" ;;
  1310. X    esac
  1311. X    $echo " "
  1312. X    $echo $n "Where is the inews program located on your system? [$dflt] $c"
  1313. X    . myread
  1314. X    case $ans in
  1315. X      '') ans=$dflt ;;
  1316. X    esac
  1317. done
  1318. inews=$ans
  1319. X
  1320. X: determine where manual pages go
  1321. case "$mansrc" in
  1322. X'')
  1323. X    dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
  1324. X    ;;
  1325. X*)  dflt="$mansrc"
  1326. X    ;;
  1327. esac
  1328. mansrc='blurfl/dyick'
  1329. while $test ! -d "$mansrc" ; do
  1330. X    case $mansrc in
  1331. X      blurfl*) ;;
  1332. X      *) $echo "$mansrc does not appear to exist." ;;
  1333. X    esac
  1334. X    $echo " "
  1335. X    $echo $n "Where do the manual pages (source) go? [$dflt] $c"
  1336. X    . myread
  1337. X    mansrc=`filexp "$ans"`
  1338. X    case $mansrc in
  1339. X      '') mansrc=$dflt ;;
  1340. X    esac
  1341. done
  1342. case "$mansrc" in
  1343. X*l)
  1344. X    manext=l
  1345. X    ;;
  1346. X*n)
  1347. X    manext=n
  1348. X    ;;
  1349. X*)
  1350. X    manext=1
  1351. X    ;;
  1352. esac
  1353. X
  1354. X: determine where mail is spooled
  1355. case "$maildir" in
  1356. X'')
  1357. X    dflt=`loc . /usr/spool/mail /usr/spool/mail /usr/mail`
  1358. X    ;;
  1359. X*)  dflt="$maildir"
  1360. X    ;;
  1361. esac
  1362. case "$dflt" in
  1363. X*%L*|*%~*) ;;
  1364. X
  1365. X*)    dflt="$dflt/%L"
  1366. esac
  1367. X$cat <<'EOM'
  1368. X
  1369. Trn needs to know where to find yet-to-be-read mail.  Sendmail sites
  1370. use /usr/spool/mail/%L (where '%L' is the user's login name).  Some
  1371. MMDF sites use /usr/%L/.mail instead.
  1372. X
  1373. XEOM
  1374. X$echo $n "Where is yet-to-be-read mail spooled? [$dflt] $c"
  1375. X. myread
  1376. maildir="$ans"
  1377. case $maildir in
  1378. X'') maildir=$dflt ;;
  1379. esac
  1380. X
  1381. X: find out how to find out full name
  1382. X$echo " "
  1383. case "$berknam" in
  1384. define)
  1385. X    dflt=y;;
  1386. undef)
  1387. X    dflt=n;;
  1388. X*)
  1389. X    if bsd || xenix; then
  1390. X    dflt=y
  1391. X    else
  1392. X    dflt=n
  1393. X    fi
  1394. X    ;;
  1395. esac
  1396. X$echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
  1397. X$echo $n "thing after ':' in GCOS field)? [$dflt] $c"
  1398. X. myread
  1399. case $ans in
  1400. X  '') ans=$dflt ;;
  1401. esac
  1402. case $ans in
  1403. X  y*)
  1404. X    passnam=define
  1405. X    berknam=define
  1406. X    usgnam=undef
  1407. X    nametype=bsd
  1408. X    ;;
  1409. X  *)
  1410. X    $echo " "
  1411. X    case "$usgnam" in
  1412. X    define)
  1413. X    dflt=y;;
  1414. X    undef)
  1415. X    dflt=n;;
  1416. X    *)
  1417. X    if usg; then
  1418. X        dflt=y
  1419. X    else
  1420. X        dflt=n
  1421. X    fi
  1422. X    ;;
  1423. X    esac
  1424. X    $echo "Does your passwd file keep full names in USG format (name sandwiched"
  1425. X    $echo $n "between a '-' and a '(')? [$dflt] $c"
  1426. X    . myread
  1427. X    case $ans in
  1428. X      '') ans=$dflt ;;
  1429. X    esac
  1430. X    case $ans in
  1431. X      n*)
  1432. X    $echo "Full name will be taken from ~/.fullname"
  1433. X    passnam=undef
  1434. X    berknam=undef
  1435. X    usgnam=undef
  1436. X    nametype=other
  1437. X    ;;
  1438. X      *)
  1439. X    passnam=define
  1440. X    berknam=undef
  1441. X    usgnam=define
  1442. X    nametype=usg
  1443. X    ;;
  1444. X    esac
  1445. X    ;;
  1446. esac
  1447. X
  1448. X: see if we should throw a -i into the Makefile
  1449. X$echo " "
  1450. if pdp11; then
  1451. X    if $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1452. X    $echo $n "Your system appears to have separate I and D space.  Is this true? [y] $c"
  1453. X    . myread
  1454. X    case $ans in
  1455. X        n*|f*) iandd='' ;;
  1456. X        *)     iandd=' -i' ;;
  1457. X    esac
  1458. X    else
  1459. X    $echo "Your system appears to NOT have separate I and D space."
  1460. X    $echo $n "Is this correct? [y] $c"
  1461. X    . myread
  1462. X    case $ans in
  1463. X        n*|f*) iandd=' -i' ;;
  1464. X        *)     iandd='' ;;
  1465. X    esac
  1466. X    fi
  1467. else
  1468. X    $echo "Not a pdp11--assuming no separate I and D."
  1469. X    iandd=''
  1470. fi
  1471. X
  1472. X: set the right options for cc and include the x library for XENIX
  1473. if xenix; then
  1474. X    if $test -d /lib/386 ; then
  1475. X    iandd=" -M3e"
  1476. X    else
  1477. X:    iandd=" -M2let8 -LARGE -F 3000"
  1478. X    iandd=" -Ml2et32 -LARGE -F B000"
  1479. X    fi
  1480. X    xnxlib=-lx
  1481. X    chsize=define
  1482. else
  1483. if $test -r /lib/libx.a -a -f /xenix ; then
  1484. X    $echo "Found Xenix library; using chsize()"
  1485. X    xnxlib=-lx
  1486. X    chsize=define
  1487. else
  1488. X    xnxlib=''
  1489. X    chsize=undef
  1490. fi
  1491. fi
  1492. X
  1493. X: see if we need a special compiler
  1494. if usg; then
  1495. X    case "$cc" in
  1496. X    '')
  1497. X    case "$Mcc" in
  1498. X    /*) dflt='Mcc'
  1499. X        ;;
  1500. X    *)
  1501. X        if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1502. X        dflt='cc -M'
  1503. X        else
  1504. X        dflt='cc'
  1505. X        fi
  1506. X        ;;
  1507. X    esac
  1508. X    ;;
  1509. X    *)  dflt="$cc";;
  1510. X    esac
  1511. X    $cat <<'EOM'
  1512. On some systems the default C compiler will not resolve multiple global
  1513. references that happen to have the same name.  On some such systems the
  1514. X"Mcc" command may be used to force these to be resolved.  On other systems
  1515. a "cc -M" command is required.  If gcc is available you might want to use
  1516. XEOM
  1517. X    $echo $n "that.  What command will force resolution on this system? [$dflt] $c"
  1518. X    . myread
  1519. X    cc="$ans"
  1520. X    case "$cc" in
  1521. X    '') cc="$dflt";;
  1522. X    *)  cflags='';;
  1523. X    esac
  1524. else
  1525. X    case "$cc" in
  1526. X    '') dflt="cc";;
  1527. X    *)  dflt="$cc";;
  1528. X    esac
  1529. X    cat <<'EOM'
  1530. X
  1531. We need a C compiler that can resolve multiple global references, and since
  1532. this isn't a USG system, cc should work just fine.  However, you may want to
  1533. XEOM
  1534. X    $echo $n "use gcc or something else.  What C compiler should we use? [$dflt] $c"
  1535. X    . myread
  1536. X    case "$ans" in
  1537. X    '') ans="$dflt";;
  1538. X    *)  cflags='';;
  1539. X    esac
  1540. X    cc="$ans"
  1541. fi
  1542. X
  1543. X: see about the C options
  1544. case "$cflags" in
  1545. X'') dflt="-O$posix$iandd$addcflags";;
  1546. X*)  dflt="$cflags";;
  1547. esac
  1548. cat <<EOM
  1549. X
  1550. The following C flags should do the job on your system.  However, if you need
  1551. to omit a -O, add a -traditional or whatever, here's your chance.  What flags
  1552. XEOM
  1553. X$echo $n "does $cc need? [$dflt] $c"
  1554. X. myread
  1555. case "$ans" in
  1556. X'') ans="$dflt";;
  1557. esac
  1558. cflags="$ans"
  1559. X
  1560. X: index or strcpy
  1561. X$echo " "
  1562. if $contains '^index$' libc.list >/dev/null 2>&1 ; then
  1563. X    $echo "Your system appears to use index() and rindex() rather than strchr()"
  1564. X    $echo $n "and strrchr().  Is this correct? [y] $c"
  1565. X    . myread
  1566. X    case $ans in
  1567. X    n*|f*) strchr='define' ;;
  1568. X    *)     strchr='undef' ;;
  1569. X    esac
  1570. else
  1571. X    $echo "Your system appears to use strchr() and strrchr() rather than index()"
  1572. X    $echo $n "and rindex().  Is this correct? [y] $c"
  1573. X    . myread
  1574. X    case $ans in
  1575. X    n*|f*) strchr=undef ;;
  1576. X    *)     strchr=define ;;
  1577. X    esac
  1578. fi
  1579. X
  1580. X: bcopy/bzero or memcpy/memset
  1581. X$echo " "
  1582. if $contains '^bcopy$' libc.list >/dev/null 2>&1 ; then
  1583. X    $echo "Your system appears to use bcopy() and bzero() rather than memcpy()"
  1584. X    $echo $n "and memset().  Is this correct? [y] $c"
  1585. X    . myread
  1586. X    case $ans in
  1587. X    n*|f*) memcpy='define' ;;
  1588. X    *)     memcpy='undef' ;;
  1589. X    esac
  1590. else
  1591. X    $echo "Your system appears to use memcpy() and memset() rather than bcopy()"
  1592. X    $echo $n "and bzero().  Is this correct? [y] $c"
  1593. X    . myread
  1594. X    case $ans in
  1595. X    n*|f*) memcpy='undef' ;;
  1596. X    *)     memcpy='define' ;;
  1597. X    esac
  1598. fi
  1599. X
  1600. X: check for S5-style timezone handling - current offset from GMT in
  1601. X: external variable "timezone" rather than gotten with "ftime".
  1602. X$echo " "
  1603. if $contains tzname /usr/include/time.h >/dev/null 2>&1 ; then
  1604. X    $echo "Your system appears to get the current timezone's offset from GMT by using the"
  1605. X    $echo "external variable timezone rather than by calling ftime() or gettimeofday()."
  1606. X    $echo $n "Is this correct? [y] $c"
  1607. X    . myread
  1608. X    case $ans in
  1609. X    n*|f*) tzset='undef' ;;
  1610. X    *)     tzset='define' ;;
  1611. X    esac
  1612. else
  1613. X    $echo "Your system appears to get the current timezone's offset from GMT by calling"
  1614. X    $echo "ftime() or gettimeofday() rather than from the external variable timezone."
  1615. X    $echo $n "Is this correct? [y] $c"
  1616. X    . myread
  1617. X    case $ans in
  1618. X    n*|f*) tzset='define' ;;
  1619. X    *)     tzset='undef' ;;
  1620. X    esac
  1621. fi
  1622. X
  1623. X: determine how to determine when a file is a mailbox
  1624. case "$mboxchar" in
  1625. X'') dflt=F;;
  1626. X*)  dflt="$mboxchar";;
  1627. esac
  1628. X$cat <<'EOM'
  1629. In saving articles, trn wants to differentiate between saving to mailbox
  1630. format files and normal files.  It does this by examining the first character
  1631. of the file in question.  On most systems the first line starts "From...",
  1632. so the first character is F.  On other systems there are magic cookies like
  1633. control codes between articles, so one of those would be first.  For example,
  1634. MMDF messages are separated with lines of 4 control-A's.  On your system, if a
  1635. XEOM
  1636. X$echo $n "file is in mailbox format, what is the first character of that file? [$dflt] $c"
  1637. X. myread
  1638. mboxchar="$ans"
  1639. case $mboxchar in
  1640. X'') mboxchar="$dflt" ;;
  1641. esac
  1642. case $mboxchar in
  1643. X'F') ;;
  1644. X"$CTRLA") ;;
  1645. X*)  cat <<'EOM'
  1646. You will need to edit the shell script mbox.saver to properly append an
  1647. article to a mailbox.  The arguments to the script are documented in
  1648. XEOM
  1649. X    case $shsharp in
  1650. X    false)
  1651. X    $echo "comments in mbox.saver.std."
  1652. X    ;;
  1653. X    true)
  1654. X    $echo "comments in the shell script itself."
  1655. X    ;;
  1656. X    esac
  1657. esac
  1658. X$rm -f grimble
  1659. X: where do we get termlib routines from
  1660. X$echo " "
  1661. ans=`loc libcurses.a x /usr/lib /usr/local/lib /lib`
  1662. case "$ans" in
  1663. X/*)
  1664. X    if test -f /bin/smit; then
  1665. X    termlib='-lcurses'
  1666. X    havetlib=define
  1667. X    $echo "Using -lcurses and assuming terminfo, since this looks like AIX."
  1668. X    else
  1669. X    ar t $ans >grimble
  1670. X    if $contains tputs grimble >/dev/null 2>&1; then
  1671. X        termlib='-lcurses'
  1672. X        havetlib=define
  1673. X        $echo "Terminfo library found."
  1674. X    else
  1675. X        ans=x
  1676. X    fi
  1677. X    fi
  1678. X    ;;
  1679. esac
  1680. case "$ans" in
  1681. x)
  1682. X    ans=`loc libtermlib.a x /usr/lib /usr/local/lib /lib`
  1683. X    case "$ans" in
  1684. X    /usr/lib*|/lib*)
  1685. X    termlib='-ltermlib'
  1686. X    havetlib=define
  1687. X    $echo "Termlib library found."
  1688. X    ;;
  1689. X    /*)
  1690. X    termlib="$ans"
  1691. X    havetlib=define
  1692. X    $echo "Termlib library found."
  1693. X    ;;
  1694. X    *)
  1695. X    if xenix; then
  1696. X        ans=/lib/Llibtermcap.a
  1697. X    else
  1698. X        ans=`loc libtermcap.a x /usr/lib /usr/local/lib /lib`
  1699. X    fi
  1700. X    case "$ans" in
  1701. X    /usr/lib*|/lib*)
  1702. X        termlib='-ltermcap'
  1703. X        havetlib=define
  1704. X        $echo "Termcap library found."
  1705. X        ;;
  1706. X    /*)
  1707. X        termlib="$ans"
  1708. X        havetlib=define
  1709. X        $echo "Termcap library found."
  1710. X        ;;
  1711. X    *)
  1712. X        case "$termlib" in
  1713. X        '')
  1714. X        $echo $n "Your system appears to NOT have termlib-style routines.  Is this true? [y] $c"
  1715. X        . myread
  1716. X        case $ans in
  1717. X            n*|f*) havetlib=define
  1718. X              $echo "Then where are the termlib-style routines kept (specify either -llibname"
  1719. X              $echo $n " or full pathname (~name ok))? $c"
  1720. X              . myread
  1721. X              termlib=`filexp $ans`
  1722. X              ;;
  1723. X            *)    havetlib=undef
  1724. X              termlib=''
  1725. X              $echo "You will have to play around with term.c then."
  1726. X              ;;
  1727. X        esac
  1728. X        $echo " "
  1729. X        ;;
  1730. X        *)  $echo "You said termlib was $termlib before."
  1731. X        ;;
  1732. X        esac
  1733. X        ;;
  1734. X    esac
  1735. X    ;;
  1736. X    esac
  1737. X    ;;
  1738. esac
  1739. X: see if there is a whoami file
  1740. if $test -r /usr/include/whoami.h ; then
  1741. X    whoami=define
  1742. X    $echo "whoami.h found."
  1743. else
  1744. X    whoami=undef
  1745. fi
  1746. X
  1747. X: see if this is a termio/termios/sgtty system
  1748. if ultrix || sun || pyr ; then
  1749. X    termio=undef
  1750. X    termios=undef
  1751. X    $echo "Using sgtty.h"
  1752. else
  1753. if $test -r /usr/include/termio.h ; then
  1754. X    termio=define
  1755. X    termios=undef
  1756. X    $echo "termio.h found."
  1757. else
  1758. if test -d /usr/convex ; then
  1759. X    termio=undef
  1760. X    termios=define
  1761. X    $echo "termios.h found."
  1762. else
  1763. if $test -r /usr/include/sgtty.h ; then
  1764. X    termio=undef
  1765. X    termios=undef
  1766. X    $echo "sgtty.h found."
  1767. else
  1768. X    termio=undef
  1769. X    termios=undef
  1770. X    $echo "Neither termio.h nor sgtty.h found--you could have problems."
  1771. fi
  1772. fi
  1773. fi
  1774. fi
  1775. X
  1776. X: see if this system has fcntl
  1777. if $test -r /usr/include/fcntl.h ; then
  1778. X    fcntl=define
  1779. X    $echo "fcntl.h found."
  1780. else
  1781. X    fcntl=undef
  1782. X    $echo "No fcntl.h found, but that's ok."
  1783. fi
  1784. X
  1785. X: see if ioctl defs are in sgtty/termio or sys/ioctl
  1786. if $test -r /usr/include/sys/ioctl.h ; then
  1787. X    ioctl=define
  1788. X    $echo "sys/ioctl.h found."
  1789. else
  1790. X    ioctl=undef
  1791. X    $echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
  1792. fi
  1793. X
  1794. X: see if ptem.h exists
  1795. if $test -r /usr/include/sys/ptem.h ; then
  1796. X    ptem=define
  1797. X    $echo "sys/ptem.h found."
  1798. else
  1799. X    ptem=undef
  1800. fi
  1801. X
  1802. X: see if the system has sigblock
  1803. if $contains '^sigblock$' libc.list >/dev/null 2>&1 ; then
  1804. X    if sgi; then
  1805. X    $echo "sigblock() found and ignored on this Silicon Graphics box"
  1806. X    sigblock=undef
  1807. X    else
  1808. X    $echo "sigblock() found."
  1809. X    sigblock=define
  1810. X    fi
  1811. else
  1812. X    sigblock=undef
  1813. fi
  1814. X
  1815. X: see if the system has setbuffer
  1816. if $contains '^setbuffer$' libc.list >/dev/null 2>&1 ; then
  1817. X    $echo "setbuffer() found."
  1818. X    setvbuf=undef
  1819. X    setbuffer=define
  1820. else
  1821. X: see if the system has setvbuf
  1822. if $contains '^setvbuf$' libc.list >/dev/null 2>&1 ; then
  1823. X    $echo "setvbuf() found."
  1824. X    setvbuf=define
  1825. X    setbuffer=undef
  1826. else
  1827. X    $echo "neither setbuffer() or setvbuf() found, punting to standard buffers."
  1828. X    setvbuf=undef
  1829. X    setbuffer=undef
  1830. fi
  1831. fi
  1832. X
  1833. X: see if the system has getwd
  1834. if $contains '^getwd$' libc.list >/dev/null 2>&1 ; then
  1835. X    $echo "getwd() found."
  1836. X    getcwd=undef
  1837. X    getwd=define
  1838. else
  1839. X: see if the system has getcwd
  1840. if $contains '^getcwd$' libc.list >/dev/null 2>&1 ; then
  1841. X    $echo "getcwd() found."
  1842. X    getcwd=define
  1843. X    getwd=undef
  1844. else
  1845. X    getcwd=undef
  1846. X    getwd=undef
  1847. fi
  1848. fi
  1849. X
  1850. X: see if there is a vfork
  1851. if $contains '^vfork$' libc.list >/dev/null 2>&1 ; then
  1852. X    $echo "vfork() found."
  1853. X    novfork='undef'
  1854. X    if sgi; then
  1855. X        $echo "However, IRIX vfork() is buggy. We'll use fork() instead."
  1856. X        novfork='define'
  1857. X    fi
  1858. else
  1859. X    if next; then
  1860. X    $echo "I know NeXTs have vfork()!"
  1861. X    novfork='undef'
  1862. X    else
  1863. X    $echo "No vfork() found--will use fork() instead."
  1864. X    novfork='define'
  1865. X    fi
  1866. fi
  1867. X
  1868. X: check for rename
  1869. if $contains '^rename$' libc.list >/dev/null 2>&1 ; then
  1870. X    $echo "rename() found."
  1871. X    rename='define'
  1872. else
  1873. X    $echo "No rename() found -- we'll emulate it."
  1874. X    rename='undef'
  1875. fi
  1876. X
  1877. X: check for ftruncate
  1878. if $contains '^ftruncate$' libc.list >/dev/null 2>&1 ; then
  1879. X    $echo "ftruncate() found."
  1880. X    ftruncate='define'
  1881. else
  1882. X    $echo "No ftruncate() found -- we'll try to fake it."
  1883. X    ftruncate='undef'
  1884. fi
  1885. X
  1886. X: check for usleep or select
  1887. if $contains '^usleep$' libc.list >/dev/null 2>&1 ; then
  1888. X    $echo "usleep() found."
  1889. X    usleep='define'
  1890. X    uselect='undef'
  1891. else
  1892. X    usleep='undef'
  1893. X    if $contains '^select$' libc.list >/dev/null 2>&1 ; then
  1894. X    $echo "No usleep() found -- we'll use select to emulate it."
  1895. X    uselect='define'
  1896. X    else
  1897. X    $echo "No usleep() found -- we'll use sleep() instead."
  1898. X    uselect='undef'
  1899. X    fi
  1900. fi
  1901. X
  1902. X: check for strftime
  1903. if $contains '^strftime$' libc.list >/dev/null 2>&1 ; then
  1904. X    $echo "strftime() found."
  1905. X    strftime='define'
  1906. else
  1907. X    $echo "No strftime() found -- we'll emulate it."
  1908. X    strftime='undef'
  1909. fi
  1910. X
  1911. X: see if YP could be running here
  1912. if $contains 'yp_master$' libc.list >/dev/null 2>&1 ; then
  1913. X    $echo "YP may be running -- will use getpwent(), just in case."
  1914. X    getpwent='define'
  1915. else
  1916. X: see if there is a getpwent
  1917. if $contains '^getpwent$' libc.list >/dev/null 2>&1 ; then
  1918. X    $echo "getpwent() found."
  1919. X    getpwent='define'
  1920. else
  1921. X    $echo "No getpwent() found--will use getpw() instead."
  1922. X    getpwent='undef'
  1923. fi
  1924. fi
  1925. X
  1926. X: default
  1927. sigret=void
  1928. X: determine type of signal function
  1929. if next; then
  1930. X    sigret=int
  1931. else
  1932. if stardent || sgi ; then
  1933. X    sigret=void
  1934. else
  1935. if test -f /usr/include/signal.h ; then
  1936. X    $cpp /usr/include/signal.h >sigtest
  1937. else
  1938. if test -f /usr/include/sys/signal.h ; then
  1939. X    $cpp /usr/include/sys/signal.h >sigtest
  1940. fi
  1941. fi
  1942. if $contains 'int[^A-Za-z]*signal' sigtest >/dev/null 2>&1 ; then
  1943. X    sigret=int
  1944. fi
  1945. fi
  1946. fi
  1947. X$echo "signal() returns $sigret on this system."
  1948. X: see how we will look up site name
  1949. douname=undef
  1950. gethostname=undef
  1951. phostname=undef
  1952. if $test ! "X$hostfile" = X ; then
  1953. X    gethostname=define
  1954. else
  1955. if $test "X$hostcmd" = X ; then
  1956. X    : it is already compiled in
  1957. else
  1958. if $contains '^gethostnam' libc.list >/dev/null 2>&1 ; then
  1959. X    $echo "gethostname() found."
  1960. X    gethostname=define
  1961. else
  1962. X    if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  1963. X    $echo "uname() found."
  1964. X    douname=define
  1965. X    else
  1966. X    case $hostcmd in
  1967. X      '') ;;
  1968. X      *)
  1969. X        $cat <<EOT
  1970. There is no gethostname() or uname() on this system.  You have two
  1971. possibilites at this point:
  1972. X
  1973. X1)  You can have your site name ($sitename) compiled into trn, which lets
  1974. X    trn start up faster, but makes your binaries non-portable, or
  1975. X2)  you can have trn use a
  1976. X    
  1977. X    popen("$hostcmd","r")
  1978. X
  1979. X    which will start slower but be more portable.
  1980. X
  1981. Option 1 will use whoami.h if you have one.  If you want option 2 but with
  1982. a different command, you can edit config.h after this shell script is done.
  1983. X
  1984. XEOT
  1985. X        case "$phostname" in
  1986. X        define) dflt=n;;
  1987. X        undef)  dflt=y;;
  1988. X        '')
  1989. X        case $portable in
  1990. X        define) dflt=n ;;
  1991. X        *)      dflt=y ;;
  1992. X        esac
  1993. X        ;;
  1994. X        esac
  1995. X        $echo $n "Do you want your site name compiled in? [$dflt] $c"
  1996. X        . myread
  1997. X        case $ans in
  1998. X        '') ans=$dflt;;
  1999. X        esac
  2000. X        case $ans in
  2001. X          n*) phostname=define ;;
  2002. X          *)  hostcmd='' phostname=undef;;
  2003. X        esac
  2004. X        ;;
  2005. X    esac
  2006. X    case $hostcmd in
  2007. X      '')
  2008. X        case $whoami in
  2009. X          define)
  2010. X        $echo 'No hostname function--using whoami.h.'
  2011. X        ;;
  2012. X          undef)
  2013. X        $echo 'No hostname function--hardwiring "'$sitename'".'
  2014. X        ;;
  2015. X        esac
  2016. X        ;;
  2017. X    esac
  2018. X    fi
  2019. fi
  2020. fi
  2021. fi
  2022. X
  2023. X: see if we need -ljobs and if we have sigset, etc.
  2024. if $test -r /usr/lib/libjobs.a -o -r /usr/local/lib/libjobs.a ; then
  2025. X    $echo "Jobs library found."
  2026. X    normsig=undef
  2027. X    jobslib='-ljobs'
  2028. else
  2029. X    if bsd; then
  2030. X    $echo "No jobs library found.  (I suppose this is at least 4.2...)"
  2031. X    else
  2032. X    $echo "No jobs library found.  (That's okay, we all have our faults.)"
  2033. X    fi
  2034. X    if $contains '^sigset$' libc.list >/dev/null 2>&1 ; then
  2035. X    $echo "However, sigset() does exist, so we'll make use of it."
  2036. X    normsig=undef
  2037. X    else
  2038. X        normsig=define
  2039. X    fi
  2040. X    jobslib=''
  2041. fi
  2042. X: use sighold and sigrelse?
  2043. if $contains '^sighold$' libc.list >/dev/null 2>&1 ; then
  2044. X    $echo "sighold() found"
  2045. X    sighold=define
  2046. X    else
  2047. X        sighold=undef
  2048. fi
  2049. X: No Steve jokes...
  2050. if next; then
  2051. X    jobslib='-lsys_s'
  2052. fi
  2053. X: see if there are directory access routines out there
  2054. X    ndirlib=''
  2055. X    libndir=undef
  2056. X    if $contains '^readdir$' libc.list >/dev/null 2>&1 ; then
  2057. X    $echo "readdir() found."
  2058. X    usendir=undef
  2059. X    ndirc=''
  2060. X    ndiro=''
  2061. X    if sgi ; then
  2062. X        dirtype=direct
  2063. X        dirinc="<sys/dir.h>"
  2064. X        $echo "Using direct directory structure."
  2065. X    else 
  2066. X        if $test -r /usr/include/dirent.h ; then
  2067. X            $echo "Using dirent directory structure."
  2068. X                dirtype=dirent
  2069. X            dirinc="<dirent.h>"
  2070. X        else
  2071. X            $echo "Using direct directory structure."
  2072. X                dirtype=direct
  2073. X            dirinc="<sys/dir.h>"
  2074. X        fi
  2075. X    fi
  2076. X     else
  2077. X    if xenix; then
  2078. X        $echo "Using Xenix readdir() from -lx."
  2079. X        usendir=undef
  2080. X        ndirc=''
  2081. X        ndiro=''
  2082. X        dirtype=direct
  2083. X        dirinc="<sys/ndir.h>"
  2084. X        $echo "Using direct directory structure."
  2085. X    else
  2086. X        if $test -r /usr/lib/libndir.a -o -r /usr/local/lib/libndir.a ; then
  2087. X            $echo "ndir library found."
  2088. X                if $test -r /usr/lib/libndir.a; then
  2089. X                ndirlib='-lndir'
  2090. X                else
  2091. X                ndirlib="/usr/local/lib/libndir.a"
  2092. X                fi
  2093. X            libndir=define
  2094. X            usendir=undef
  2095. X            ndirc=''
  2096. X            ndiro=''
  2097. X            dirtype=direct
  2098. X            dirinc="<ndir.h>"
  2099. X        else
  2100. X                $echo "No ndir library and no readdir()--using ./ndir.c."
  2101. X                usendir=define
  2102. X                ndirc='ndir.c'
  2103. X                ndiro='ndir.o'
  2104. X                dirtype=direct
  2105. X    fi
  2106. X    fi
  2107. fi
  2108. X
  2109. X: check if they want threads by default
  2110. case "$threaddef" in
  2111. X    F*) dflt="n";;
  2112. X    *)  dflt="y";;
  2113. esac
  2114. X$cat <<'EOM'
  2115. X
  2116. Trn has two distinct operating modes (selected by the -x option):
  2117. traditional rn and threaded rn.  If you like, trn will check the first
  2118. letter of the command name and default to threaded mode (-x) if it is
  2119. a 't', or run as traditional rn (+x) if it isn't (this lets you install
  2120. as both trn and rn, linked together).  Otherwise, you can install trn
  2121. to default to threaded rn (-x) no matter what its name is.  Would you
  2122. XEOM
  2123. X$echo $n "prefer the latter? (defaults to -x, regardless of name)? [$dflt] $c"
  2124. X. myread
  2125. case "$ans" in
  2126. X'') ans="$dflt";;
  2127. esac
  2128. case "$ans" in
  2129. X    n*|f*) threaddef='FALSE'
  2130. X       ans=' when -x is specified';;
  2131. X    *)     threaddef='TRUE'
  2132. X       ans='';;
  2133. esac
  2134. X: check if they want the thread selector used by default
  2135. case "$selectdef" in
  2136. X    F*) dflt="n";;
  2137. X    *)  dflt="y";;
  2138. esac
  2139. X$cat <<'EOM'
  2140. X
  2141. When the -X option is specified, trn will set the default command
  2142. for starting a newsgroup to be the thread selector.  Should the -X
  2143. XEOM
  2144. X$echo $n "option be on by default$ans? [$dflt] $c"
  2145. X. myread
  2146. case "$ans" in
  2147. X'') ans="$dflt";;
  2148. esac
  2149. case "$ans" in
  2150. X    n*|f*) selectdef='FALSE';;
  2151. X    *)     selectdef='TRUE';;
  2152. esac
  2153. X: check if they have and want to use syslog for the log file in mthreads
  2154. if $contains '^syslog$' libc.list >/dev/null 2>&1 ; then
  2155. X    case $syslog in
  2156. X    '') dflt=n ;;
  2157. X    *)  dflt=y ;;
  2158. X    esac
  2159. X    $echo " "
  2160. X    $echo "Mthreads can either use a custom log file or the syslog functions for"
  2161. X    $echo $n "maintaining its log messages.  Would you prefer to use syslog? [$dflt] $c"
  2162. X    . myread
  2163. X    case "$ans" in
  2164. X    '') ans="$dflt";;
  2165. X    esac
  2166. X    case $ans in
  2167. X    n*) syslog='' ;;
  2168. X    *)  case $syslog in
  2169. X        LOG_*) dflt="$dflt" ;;
  2170. X        *)     dflt=LOG_NEWS ;;
  2171. X        esac
  2172. X        $cat <<'EOM'
  2173. X
  2174. If your syslog has LOG_NEWS or LOG_DAEMON, you'll probably want to use
  2175. one of these for your logging.  If it doesn't, accept the default and
  2176. XEOM
  2177. X        $echo $n "we'll figure that out later.  Your choice? [$dflt] $c"
  2178. X        . myread
  2179. X        case "$ans" in
  2180. X        '') ans="$dflt";;
  2181. X        esac
  2182. X        syslog="$ans"
  2183. X        ;;
  2184. X    esac
  2185. else
  2186. X        syslog=''
  2187. fi
  2188. X
  2189. X: locate spool directory and check if rrn
  2190. case "$isrrn" in
  2191. define)
  2192. X    dflt="y";;
  2193. X*)
  2194. X    dflt="n";;
  2195. esac
  2196. isrrn=''
  2197. while $test -z "$isrrn" ; do
  2198. X    $echo " "
  2199. X    $echo $n "Do you want to build the NNTP version of trn? [$dflt] $c"
  2200. X    . myread
  2201. X    case "$ans" in
  2202. X    '') ans="$dflt";;
  2203. X    esac
  2204. X    case "$ans" in
  2205. X    n*)
  2206. X    isrrn=undef
  2207. X    xthread=undef
  2208. X    serverspool=''
  2209. X    ;;
  2210. X    y*)
  2211. X    isrrn=define
  2212. X    case "$xthread" in
  2213. X    define)
  2214. X        dflt="y";;
  2215. X    *)
  2216. X        dflt="n";;
  2217. X    esac
  2218. X    $echo " "
  2219. X    $echo "Do you want to use the (unofficial) XTHREAD command to grab the thread files"
  2220. X    $echo $n "via NNTP instead of using a local database?  (Requires a modified NNTP!) [$dflt] $c"
  2221. X    . myread
  2222. X    case "$ans" in
  2223. X    '') ans="$dflt";;
  2224. X    esac
  2225. X    case "$ans" in
  2226. X    y*) xthread=define
  2227. X        case "$serverspool" in
  2228. X        '') dflt="n";;
  2229. X        *)  dflt="y";;
  2230. X        esac
  2231. X        $cat <<'EOM'
  2232. X
  2233. The client machines won't need to run mthreads at all then.  As such, you
  2234. have the option of creating the server version of mthreads, or nothing at
  2235. XEOM
  2236. X        $echo $n "all.  Do you want to create mthreads for the server? [$dflt] $c"
  2237. X        . myread
  2238. X        case "$ans" in
  2239. X        '') ans="$dflt";;
  2240. X        esac
  2241. X        case "$ans" in
  2242. X        y*) case "$serverspool" in
  2243. X        '') dflt="/usr/spool/news";;
  2244. X        *)  dflt="$serverspool";;
  2245. X        esac
  2246. X        $echo " "
  2247. X        $echo $n "What directory does the SERVER spool news into? [$dflt] $c"
  2248. X        . myread
  2249. X        case "$ans" in
  2250. X        '') ans="$dflt";;
  2251. X        esac
  2252. X        serverspool="$ans"
  2253. X        ;;
  2254. X        *)  serverspool=''
  2255. X        ;;
  2256. X        esac
  2257. X        ;;
  2258. X    *)  xthread=undef
  2259. X        serverspool=''
  2260. X        $echo "Ok, mthreads will also be an NNTP client."
  2261. X        ;;
  2262. X    esac
  2263. X    spool=/tmp
  2264. X    $echo "net.foobar 00001 00001 y" > .falseactive
  2265. X
  2266. X    case "$serverfile" in
  2267. X    '')  dflt="no default" ;;
  2268. X    *)   dflt="$serverfile";;
  2269. X    esac
  2270. X
  2271. X    $cat <<'EOM'
  2272. X
  2273. Trrn determines the machine to use as a news server by two means:
  2274. X
  2275. XFirst:    It examines the environment variable NNTPSERVER for a machine name.
  2276. X    If present, this name is used in preference to the default.
  2277. X
  2278. XElse:    It uses the default machine name, which is either read from a file
  2279. X    or compiled into trn.
  2280. X
  2281. It is your choice whether you wish the default machine name to be read
  2282. from a file or specified directly.  To distinguish the two, a filename
  2283. must start with a slash or a tilde, and it must already exist with the
  2284. server name in it (it can contains comments (#) and blank lines also).
  2285. Any other answer is assumed to be a machine name.  If you use an alias
  2286. X(such as "news-server") you can use your nameserver to map the name to
  2287. the actual machine.
  2288. X
  2289. XEOM
  2290. X
  2291. X    while : ; do
  2292. X        $echo $n "Enter the file name (~name ok) or machine name: [$dflt] $c"
  2293. X        . myread
  2294. X        case "$ans" in
  2295. X        '') ans="$dflt";;
  2296. X        esac
  2297. X        ans=`filexp "$ans"`
  2298. X        case "$ans" in
  2299. X        /*)    $test -r $ans && break
  2300. X        $echo "File $ans does not exist."
  2301. X        ;;
  2302. X        *)    break
  2303. X        ;;
  2304. X        esac
  2305. X    done
  2306. X    serverfile="$ans"
  2307. X
  2308. X    case "$NNTPSRC" in
  2309. X    '') dflt="no default";;
  2310. X    *)  dflt="$NNTPSRC";;
  2311. X    esac
  2312. X
  2313. X    ans='blurfl/dyick'
  2314. X    while $test ! -d "$ans"; do
  2315. X        $echo " "
  2316. X        $echo $n "Enter the pathname of the NNTP source directory: [$dflt] $c"
  2317. X        . myread
  2318. X        case "$ans" in
  2319. X        '') ans="$dflt";;
  2320. X        esac
  2321. X        ans=`filexp "$ans"`
  2322. X        if $test ! -r $ans/common/nntp.h ; then
  2323. X        $echo "Can't find $ans/common/nntp.h!"
  2324. X        ans='blurfl/dyick'
  2325. X        fi
  2326. X    done
  2327. X    NNTPSRC="$ans"
  2328. X    esac
  2329. X
  2330. done
  2331. X: hack for Unisys NET-5000 and Interactive V/386
  2332. case "$isrrn" in
  2333. define) 
  2334. X: NET-5000
  2335. X    if $test -d /usr/include/NET-5000 ; then
  2336. X    $echo "I sense you are on a Unisys 5000 computer...poor soul."
  2337. X    rrninclude="-I/usr/include/NET-5000 -DEXCELAN -DUSG"
  2338. X    socketlib=-lsocket
  2339. X    fi
  2340. X: Interactive Unix
  2341. X    if $test -f /usr/lib/libinet.a ; then
  2342. X    rrninclude="-DUSG"
  2343. X    socketlib=-linet
  2344. X    fi
  2345. X    ;;
  2346. X*) ;;
  2347. esac
  2348. X
  2349. X
  2350. case "$spool" in
  2351. X'')
  2352. X    dflt=/usr/spool/news
  2353. X    ;;
  2354. X*)  dflt="$spool";;
  2355. esac
  2356. case "$isrrn" in
  2357. define)  ans=/tmp;;
  2358. X*) ans='blurfl/dyick';;
  2359. esac
  2360. while $test ! -d $ans; do
  2361. X    $echo " "
  2362. X    case "$ans" in
  2363. X    blurfl*);;
  2364. X    *) $echo "Directory $ans not found.";;
  2365. X    esac
  2366. X    $echo $n "Where is news spooled (~name ok)? [$dflt] $c"
  2367. X    . myread
  2368. X    case "$ans" in
  2369. X    '') ans="$dflt";;
  2370. X    esac
  2371. X    spool="$ans"
  2372. X    case $spool in
  2373. X    ~*)
  2374. X    ans=`filexp $spool`
  2375. X    $echo "(That is $ans on this particular system.)"
  2376. X    case $portable in
  2377. X      undef) spool=$ans ;;
  2378. X    esac
  2379. X    ;;
  2380. X    *)
  2381. X    ans=$spool
  2382. X    ;;
  2383. X    esac
  2384. done
  2385. X
  2386. X: check on .thread file placement
  2387. if $test "$isrrn " = "define " -a "$serverspool " = " " ; then
  2388. X  case "$xthread" in
  2389. X  define)
  2390. X    ans="/tmp";;
  2391. X  *)
  2392. X    case "$threaddir" in
  2393. X    ''|'.')    dflt="/usr/spool/threads";;
  2394. X    *)        dflt="$threaddir";;
  2395. X    esac
  2396. X    $echo " "
  2397. X    $echo "Pick a directory where you would like the thread files to"
  2398. X    $echo $n "be placed: [$dflt] $c"
  2399. X    . myread
  2400. X    case "$ans" in
  2401. X    ''|'.') ans="$dflt";;
  2402. X    esac
  2403. X    ;;
  2404. X  esac
  2405. else
  2406. X    case "$threaddir" in
  2407. X    ''|'.')    dflt=".";;
  2408. X    *)        dflt="$threaddir";;
  2409. X    esac
  2410. X    $cat <<'EOM'
  2411. X
  2412. By default we place each group's .thread file in the same spool
  2413. directory as the article files.  Alternately, you can place the
  2414. data files in a separate directory if space is tight on the news
  2415. XEOM
  2416. X    case "$serverspool" in
  2417. X    '') $echo "drive.  Where would you like them put?  (use '.' to specify the"
  2418. X    $echo $n "spool dir): [$dflt] $c"
  2419. X    ;;
  2420. X    *)  $echo "drive.  Where would you like them put on the SERVER?  (use '.'"
  2421. X    $echo $n "to specify the spool dir): [$dflt] $c"
  2422. X    ;;
  2423. X    esac
  2424. X    . myread
  2425. X    case "$ans" in
  2426. X    '') ans="$dflt";;
  2427. X    esac
  2428. fi
  2429. threaddir="$ans"
  2430. X
  2431. X: locate active file
  2432. case "$active" in
  2433. X'')
  2434. X    dflt=$lib/active
  2435. X    ;;
  2436. X*)  dflt="$active";;
  2437. esac
  2438. case "$isrrn" in
  2439. define) myactive=.falseactive
  2440. X    case "$serverspool" in
  2441. X    '') ;;
  2442. X    *)  $echo " "
  2443. X    $echo "What is the name of your SERVER's active file (~name ok)?"
  2444. X    $echo $n "[$dflt] $c"
  2445. X    . myread
  2446. X    case "$ans" in
  2447. X    '') ans="$dflt";;
  2448. X    esac
  2449. X    active="$ans"
  2450. X    ;;
  2451. X    esac
  2452. X    : check for active.times
  2453. X    case "$activetimes" in
  2454. X    ''|none|nntp) dflt="n";;
  2455. X    *)          dflt="y";;
  2456. X    esac
  2457. X    cat <<'EOM'
  2458. X
  2459. If your server maintains an accurate "active.times" file (as C news does), trn
  2460. can make use of the much better NEWGROUPS call in NNTP to find new groups.  If
  2461. they are running B news, talk them into running acttimes (included) or mthreads
  2462. with the -t option to maintain a fake active.times file.  Otherwise, the old
  2463. report-everything-that's-not-in-the-.newsrc method will suffice.
  2464. X
  2465. XEOM
  2466. X    $echo $n "Will your server support a reliable NEWGROUPS call? [$dflt] $c"
  2467. X    . myread
  2468. X    case "$ans" in
  2469. X    '') ans="$dflt";;
  2470. X    esac
  2471. X    case "$ans" in
  2472. X    y*) case "$serverspool" in
  2473. X    '') activetimes="nntp";;
  2474. X    *)  case "$activetimes" in
  2475. X        '') dflt="${active}.times";;
  2476. X        *)  dflt="$activetimes";;
  2477. X        esac
  2478. X        $echo " "
  2479. X        $echo "What is the name of your SERVER's active.times file?"
  2480. X        $echo $n "[$dflt] $c"
  2481. X        . myread
  2482. X        case "$ans" in
  2483. X        '') ans="$dflt";;
  2484. X        esac
  2485. X        activetimes="$ans"
  2486. X    esac
  2487. X    ;;
  2488. X    *)  activetimes='none';;
  2489. X    esac
  2490. X    ;;
  2491. X*) myactive='blurfl/dyick'
  2492. esac
  2493. while $test ! -f "$myactive"; do
  2494. X    $echo " "
  2495. X    case "$myactive" in
  2496. X    blurfl*);;
  2497. X    *) "File $myactive not found.";;
  2498. X    esac
  2499. X    $echo $n "Where is the active file (~name ok)? [$dflt] $c"
  2500. X    . myread
  2501. X    case "$ans" in
  2502. X    '') ans="$dflt";;
  2503. X    esac
  2504. X    active="$ans"
  2505. X    case $active in
  2506. X    ~*)
  2507. X    myactive=`filexp $active`
  2508. X    $echo "(That is $myactive on this particular system.)"
  2509. X    case $portable in
  2510. X      undef) active=$myactive ;;
  2511. X    esac
  2512. X    ;;
  2513. X    *)
  2514. X    myactive=$active
  2515. X    ;;
  2516. X    esac
  2517. X    if $test -d $myactive ; then
  2518. X    myactive=$myactive/active
  2519. X    active=$active/active
  2520. X    fi
  2521. X
  2522. X    : check for active.times
  2523. X    case "$activetimes" in
  2524. X    ''|none|nntp) dflt="${active}.times";;
  2525. X    *)          dflt="$activetimes";;
  2526. X    esac
  2527. X    if $test "$dflt " = "none " -o ! -f $dflt ; then
  2528. X    $cat <<'EOM'
  2529. X
  2530. If trn can use a file called active.times it can greatly speed up the
  2531. newgroup-checking code.  If you have access to a file maintained by C news,
  2532. use that.  Or, if you want to have mthreads maintain it, pick a spot for
  2533. the file and execute mthreads with the -t option.  Otherwise, specify "none"
  2534. for the good ol' slow approach.
  2535. X
  2536. XEOM
  2537. X    else
  2538. X    $cat <<EOM
  2539. X
  2540. X-- Found $dflt --
  2541. If this file is being maintained by C news, mthreads -t, or some other means,
  2542. you'll probably want to use it to greatly speed up the newgroup code.  If not
  2543. use "none" to indicate the good ol' slow approach.
  2544. X
  2545. XEOM
  2546. X    fi
  2547. X    $echo $n "Active.times file to use or 'none'? [$dflt] $c"
  2548. X    . myread
  2549. X    case "$ans" in
  2550. X    '') ans="$dflt";;
  2551. X    esac
  2552. X    activetimes="$ans"
  2553. done
  2554. X
  2555. X: check for 2.10.2 and above
  2556. X$echo " "
  2557. if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
  2558. X    case "$norelay" in
  2559. X    undef) dflt="y";;
  2560. X    *)     dflt="n";;
  2561. X    esac
  2562. X    case "$isrrn" in
  2563. X    define) 
  2564. X       $echo "Is your NNTP server running an old version of news software," ;;
  2565. X    *) $echo "Is your system running an old version of news software," ;;
  2566. X    esac
  2567. X    $echo $n "predating B News 2.10.3? [${dflt}] $c" 
  2568. X    . myread
  2569. X    case "$ans" in
  2570. X    '') ans=$dflt;;
  2571. X    esac
  2572. X    case "$ans" in
  2573. X    y*)
  2574. X      norelay='undef'
  2575. X    $echo "Looks like you are running at least 2.10.2 news."
  2576. X      ;;
  2577. X    *)  norelay='define' ;;
  2578. X    esac
  2579. X    mininact=define
  2580. else
  2581. X    $echo "It doesn't look like you are running 2.10.2 news yet.  Are you planning"
  2582. X    $echo $n "to install it in the near future? [y] $c"
  2583. X    . myread
  2584. X    case $ans in
  2585. X    n*) mininact=undef ;;
  2586. X    *)  mininact=define ;;
  2587. X    esac
  2588. X    norelay='undef'
  2589. fi
  2590. X
  2591. X
  2592. X: check for void type
  2593. X$echo " "
  2594. X$echo "Checking to see if your C compiler groks the void type..."
  2595. X$cat >try.c <<'EOCP'
  2596. void main();
  2597. XEOCP
  2598. if cc -c try.c >/dev/null 2>&1 ; then
  2599. X    novoid='undef'
  2600. X    $echo "Yup, it does."
  2601. else
  2602. X    novoid='define'
  2603. X    $echo "Nope, it doesn't (boo hiss).  I will substitute int."
  2604. fi
  2605. X$rm try.*
  2606. X
  2607. X: find out which shell people like to use most
  2608. ans='blurfl/dyick'
  2609. while $test ! -f "$ans" ; do
  2610. X    case $ans in
  2611. X      blurfl*) ;;
  2612. X      *) $echo "$ans does not appear to exist." ;;
  2613. X    esac
  2614. X    case "$pref" in
  2615. X    '')
  2616. X    if $test -f /bin/ksh; then
  2617. X        dflt='/bin/ksh'
  2618. X    else
  2619. X        if $test -f /bin/csh; then
  2620. X        dflt='/bin/csh'
  2621. X        else
  2622. X        dflt='/bin/sh'
  2623. X        fi
  2624. X    fi
  2625. X    ;;
  2626. X    *)  dflt="$pref";;
  2627. X    esac
  2628. X    $echo " "
  2629. X    $echo "Give the full path name of the shell most people like to use on your"
  2630. X    $echo $n "system: [$dflt] $c"
  2631. X    . myread
  2632. X    case $ans in
  2633. X      '') ans=$dflt ;;
  2634. X    esac
  2635. done
  2636. pref=$ans
  2637. X
  2638. X: locate the preferred pager for this system
  2639. case "$pager" in
  2640. X'')
  2641. X    case $pg in
  2642. X    /*) dflt=$pg
  2643. X    ;;
  2644. X    esac
  2645. X    case $more in
  2646. X    /*) dflt=$more
  2647. X    ;;
  2648. X    esac
  2649. X    case $dflt in
  2650. X    '') dflt=/usr/ucb/more
  2651. X    ;;
  2652. X    esac
  2653. X    ;;
  2654. X*)  dflt="$pager";;
  2655. esac
  2656. pager='blurfl/dyick'
  2657. while $test ! -f "$pager" ; do
  2658. X    case $pager in
  2659. X      blurfl*)
  2660. X    $echo " "
  2661. X    $echo "(If your kernel does terminal paging then you may answer this with '/bin/cat'.)"
  2662. X    ;;
  2663. X      /*) $echo "$pager does not appear to exist."
  2664. X    $echo " "
  2665. X        ;;
  2666. X      *) $echo "Please give the full path name."
  2667. X    $echo " "
  2668. X        ;;
  2669. X    esac
  2670. X    $echo $n "What pager is used on your system? [$dflt] $c"
  2671. X    . myread
  2672. X    pager="$ans"
  2673. X    case $pager in
  2674. X      '') pager="$dflt" ;;
  2675. X    esac
  2676. done
  2677. X
  2678. X: determine default editor
  2679. case "$defeditor" in
  2680. X'')
  2681. X    dflt=`loc vi /usr/ucb $pth`
  2682. X    ;;
  2683. X*)  dflt="$defeditor"
  2684. X    ;;
  2685. esac
  2686. defeditor='blurfl/dyick'
  2687. while $test ! -f "$defeditor" ; do
  2688. X    case $defeditor in
  2689. X      blurfl*) ;;
  2690. X      *) $echo "$defeditor does not appear to exist." ;;
  2691. X    esac
  2692. X    $echo " "
  2693. X    $echo $n "What is the default editor on your system? [$dflt] $c"
  2694. X    . myread
  2695. X    defeditor="$ans"
  2696. X    case $defeditor in
  2697. X      '') defeditor=$dflt ;;
  2698. X    esac
  2699. done
  2700. X
  2701. X: determine default mailer for Rnmail to use
  2702. X$echo " "
  2703. if $test -f /usr/lib/sendmail; then
  2704. X    dflt=/usr/lib/sendmail
  2705. else
  2706. X    if usg && $test -f $libexp/recmail; then
  2707. X        dflt=$libexp/recmail
  2708. X    else
  2709. X        dflt=/bin/mail
  2710. X    fi
  2711. fi
  2712. X$echo " "
  2713. if $test "$dflt" = "$libexp/recmail"; then
  2714. X    $echo "($libexp/recmail is a part of the news package,and can"
  2715. X    $echo "be safely used as the default mailer for the rrn package."
  2716. X    $echo "You can also use the standard /bin/mail program if you choose.)"
  2717. X    $echo " "
  2718. fi
  2719. X$echo $n "What is the default mailer on your system? [$dflt] $c"
  2720. X. ./myread                      
  2721. mailer="$ans"
  2722. case $mailer in
  2723. X    '') mailer=$dflt ;;
  2724. esac
  2725. X$echo "Mail sender is $mailer"
  2726. X
  2727. X: check for internet mailer
  2728. case "$internet" in
  2729. define) dflt=y;;
  2730. undef)    dflt=n;;
  2731. X*)
  2732. X    case "$isrrn" in
  2733. X    define) dflt=y ;;
  2734. X    *) dflt=n ;;
  2735. X    esac
  2736. X    ;;
  2737. esac
  2738. cat <<EOM
  2739. Some newer mailers can deliver mail to addresses of the INTERNET persuasion,
  2740. such as user@host.UUCP.  Other older mailers require the complete path to
  2741. the destination to be specified in the address.  Does your mailer understand
  2742. XEOM
  2743. X$echo $n "INTERNET addresses? [$dflt] $c"
  2744. X. myread
  2745. case "$ans" in
  2746. X'') ans=$dflt;;
  2747. esac
  2748. case "$ans" in
  2749. y*) internet=define;;
  2750. X*)  internet=undef;;
  2751. esac
  2752. X
  2753. X: determine where public executables go
  2754. case "$rnbin" in
  2755. X'')
  2756. X    dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  2757. X    ;;
  2758. X*)  dflt="$rnbin"
  2759. X    ;;
  2760. esac
  2761. rnbin='blurfl/dyick'
  2762. while $test ! -d "$rnbin" ; do
  2763. X    case $rnbin in
  2764. X      blurfl*) ;;
  2765. X      *) $echo "$rnbin does not appear to exist." ;;
  2766. X    esac
  2767. X    $echo " "
  2768. X    $echo $n "Where do you want to put the public executables? [$dflt] $c"
  2769. X    . myread
  2770. X    rnbin="$ans"
  2771. X    rnbin=`filexp $rnbin`
  2772. X    case $rnbin in
  2773. X      '') rnbin=$dflt ;;
  2774. X    esac
  2775. done
  2776. X
  2777. X: determine where private executables go
  2778. case "$rnlib" in
  2779. X'')
  2780. X    case "$isrrn" in
  2781. X    define) dflt=/usr/local/lib/trn ;;
  2782. X    *) dflt=$lib/trn ;;
  2783. X    esac
  2784. X    ;;
  2785. X*)  dflt="$rnlib"
  2786. X    ;;
  2787. esac
  2788. X$echo " "
  2789. X$echo "Trn has a number of auxiliary programs that need not be visible to the"
  2790. X$echo "whole world.  Where do you want to put these private executables?"
  2791. X$echo $n "[$dflt] $c"
  2792. X. myread
  2793. rnlib="$ans"
  2794. case $rnlib in
  2795. X  '') rnlib=$dflt ;;
  2796. esac
  2797. case $portable in
  2798. undef)
  2799. X    rnlib=`filexp $rnlib`
  2800. X    ;;
  2801. esac
  2802. X: must not allow self reference
  2803. case $rnlib in
  2804. X  /*)
  2805. X    filexp=$rnlib/filexp
  2806. X    ;;
  2807. X  *)
  2808. X    filexp=`pwd`/filexp
  2809. X    ;;
  2810. esac
  2811. X
  2812. X: find where to put private files for mthreads
  2813. case "$mtlib" in
  2814. X'') dflt="$rnlib" ;;
  2815. X*)  dflt="$mtlib" ;;
  2816. esac
  2817. cat <<'EOM'
  2818. X
  2819. Mthreads needs to create some private files (like active2, and maybe active1
  2820. and mt.log, depending on your setup).  These can go in the same directory as
  2821. the private executables, as long as it is writable by whoever runs mthreads.
  2822. Otherwise, a good place to put them is in your thread file directory.  Where
  2823. XEOM
  2824. X$echo $n "should these files be kept? [$dflt] $c"
  2825. X. myread
  2826. mtlib="$ans"
  2827. case "$mtlib" in
  2828. X'') mtlib=$dflt ;;
  2829. esac
  2830. X
  2831. X: get the local distribution prefixes
  2832. if $test -f $libexp/sys ; then
  2833. X    $sed <$libexp/sys -n -e "s/^$sitename://p" | \
  2834. X    $sed -e "s/:.*//" -e "s/,/ /g" | tr ' ' '\012' | \
  2835. X    $sed -e "/^to./d" -e "/^net$/d" -e "/^fa$/d" -e "/^mod$/d" > .distlist
  2836. fi
  2837. X
  2838. X$cat <<'EOH'
  2839. Distribution groups are the things you use on the Distribution line to limit
  2840. where an article will go to.  You are likely to be a member of several
  2841. distribution groups, such as organization, city, state, province, country,
  2842. continent, etc.  For example, Los Angeles has the distribution prefix "la",
  2843. New Jersey has the prefix "nj", and Europe has the prefix "eunet".
  2844. X
  2845. The categories you will be asked are: 
  2846. X
  2847. local organization    (Could be just one machine or a cluster or an office)
  2848. organization        att, dec, kgb, ...
  2849. city            la, ny, mosc, ...
  2850. state/province        ca, nj, bc, ...
  2851. country            usa, can, rok, whatever
  2852. continent        na (North America, not "Not Applicable"), asia, etc.
  2853. X
  2854. X(If you don't have a distribution prefix in any of these categories then
  2855. just hit return.)
  2856. X
  2857. XEOH
  2858. if $test -f .distlist; then
  2859. X    distlist=`tr '\012' ' ' <.distlist`
  2860. X    if $test "$distlist" ; then
  2861. X    $echo "(These are the distributions in your sys file: $distlist)"
  2862. X    $echo " "
  2863. X    fi
  2864. fi
  2865. case "$locpref" in
  2866. X'') dflt="";;
  2867. X*)  dflt="[$locpref] ";;
  2868. esac
  2869. X$echo $n "What is the distribution prefix for your local organization? $dflt$c"
  2870. X. myread
  2871. case "$ans" in
  2872. X'') ;;
  2873. X*)  locpref="$ans";;
  2874. esac
  2875. case $locpref in
  2876. X  '') locpref=none ;;
  2877. esac
  2878. case "$orgpref" in
  2879. X'') dflt="";;
  2880. X*)  dflt="[$orgpref] ";;
  2881. esac
  2882. X$echo $n "What is the distribution prefix for your organization? $dflt$c"
  2883. X. myread
  2884. case "$ans" in
  2885. X'') ;;
  2886. X*)  orgpref="$ans";;
  2887. esac
  2888. case $orgpref in
  2889. X  '') orgpref=none ;;
  2890. esac
  2891. case "$citypref" in
  2892. X'') dflt="";;
  2893. X*)  dflt="[$citypref] ";;
  2894. esac
  2895. X$echo $n "What is the distribution prefix for your city? $dflt$c"
  2896. X. myread
  2897. case "$ans" in
  2898. X'') ;;
  2899. X*)  citypref="$ans";;
  2900. esac
  2901. case $citypref in
  2902. X  '') citypref=none ;;
  2903. esac
  2904. case "$statepref" in
  2905. X'') dflt="";;
  2906. X*)  dflt="[$statepref] ";;
  2907. esac
  2908. X$echo $n "What is the distribution prefix for your state/province? $dflt$c"
  2909. X. myread
  2910. case "$ans" in
  2911. X'') ;;
  2912. X*)  statepref="$ans";;
  2913. esac
  2914. case $statepref in
  2915. X  '') statepref=none ;;
  2916. esac
  2917. case "$cntrypref" in
  2918. X'') dflt="";;
  2919. X*)  dflt="[$cntrypref] ";;
  2920. esac
  2921. X$echo $n "What is the distribution prefix for your country? $dflt$c"
  2922. X. myread
  2923. case "$ans" in
  2924. X'') ;;
  2925. X*)  cntrypref="$ans";;
  2926. esac
  2927. case $cntrypref in
  2928. X  '') cntrypref=none ;;
  2929. esac
  2930. case "$contpref" in
  2931. X'') dflt="";;
  2932. X*)  dflt="[$contpref] ";;
  2933. esac
  2934. X$echo $n "What is the distribution prefix for your continent? $dflt$c"
  2935. X. myread
  2936. case "$ans" in
  2937. X'') ;;
  2938. X*)  contpref="$ans";;
  2939. esac
  2940. case $contpref in
  2941. X  '') contpref=none ;;
  2942. esac
  2943. X
  2944. X$echo " "
  2945. X$echo "If you have any other distribution groups you will need to edit Pnews"
  2946. X$echo "and newsetup to add them."
  2947. X$echo " "
  2948. X
  2949. X: determine root id
  2950. rootid=`$sed </etc/passwd -e "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
  2951. case $rootid in
  2952. X  '') rootid=0 ;;
  2953. X  *)  $echo "Root uid = $rootid" ;;
  2954. esac
  2955. X
  2956. X: weed out incompatibilities
  2957. case $douname in
  2958. X  define) whoami=undef ;;
  2959. esac
  2960. X
  2961. X: preserve RCS keywords in files with variable substitution, grrr
  2962. Log='$Log'
  2963. Id='$Id'
  2964. X
  2965. X: Warnings
  2966. if v7; then
  2967. X    cat <<'EOM'
  2968. NOTE: the V7 compiler may ignore some #undefs that trn uses.  If so, you will
  2969. get messages about redefining EXT.  Some V7 compilers also have difficulties
  2970. with #defines near buffer boundaries, so beware.  You may have to play with
  2971. the spacing in common.h.
  2972. XEOM
  2973. fi
  2974. X
  2975. if pdp11; then
  2976. X    cat <<'EOM'
  2977. NOTE: the PDP-11 does not have enough data space to do subject caching
  2978. reliably.  That feature will be disabled automatically.  Subject searching
  2979. will tend to be slow.
  2980. XEOM
  2981. fi
  2982. case "$isrrn" in
  2983. X    define) ;;
  2984. X    *) socketlib=""
  2985. X       rrninclude=""
  2986. X     ;;
  2987. esac
  2988. X
  2989. X$echo " "
  2990. X$echo "End of configuration questions."
  2991. X$echo " "
  2992. X
  2993. X: create config.sh file
  2994. X$echo " "
  2995. X$echo "Creating config.sh..."
  2996. X$spitshell <<EOT >config.sh
  2997. X$startsh
  2998. X# config.sh
  2999. X# This file was produced by running the Configure script.
  3000. X
  3001. n='$n'
  3002. c='$c'
  3003. libc='$libc'
  3004. sharedclib='$sharedclib'
  3005. eunicefix='$eunicefix'
  3006. eunice='$eunice'
  3007. cpp='$cpp'
  3008. shsharp='$shsharp'
  3009. startsh='$startsh'
  3010. spitshell='$spitshell'
  3011. test='$test'
  3012. expr='$expr'
  3013. sed='$sed'
  3014. echo='$echo'
  3015. cat='$cat'
  3016. rm='$rm'
  3017. mv='$mv'
  3018. cp='$cp'
  3019. tail='$tail'
  3020. tr='$tr'
  3021. mkdir='$mkdir'
  3022. sort='$sort'
  3023. uniq='$uniq'
  3024. inews='$inews'
  3025. grep='$grep'
  3026. egrep='$egrep'
  3027. nidump='$nidump'
  3028. ypmatch='$ypmatch'
  3029. contains='$contains'
  3030. lib='$lib'
  3031. libexp='$libexp'
  3032. nametype='$nametype'
  3033. cc='$cc'
  3034. cflags='$cflags'
  3035. iandd='$iandd'
  3036. rrninclude='$rrninclude'
  3037. termlib='$termlib'
  3038. jobslib='$jobslib'
  3039. socketlib='$socketlib'
  3040. getcwd='$getcwd'
  3041. getwd='$getwd'
  3042. setbuffer='$setbuffer'
  3043. setvbuf='$setvbuf'
  3044. dirtype='$dirtype'
  3045. dirinc='$dirinc'
  3046. ndirlib='$ndirlib'
  3047. libndir='$libndir'
  3048. usendir='$usendir'
  3049. ndirc='$ndirc'
  3050. ndiro='$ndiro'
  3051. posix='$posix'
  3052. pager='$pager'
  3053. mailer='$mailer'
  3054. internet='$internet'
  3055. rnbin='$rnbin'
  3056. filexp='$filexp'
  3057. distlist='$distlist'
  3058. Log='$Log'
  3059. Id='$Id'
  3060. sitename='$sitename'
  3061. hostfile='$hostfile'
  3062. domain='$domain'
  3063. orgname="$orgname"
  3064. isadmin='$isadmin'
  3065. newsadmin='$newsadmin'
  3066. rnlib='$rnlib'
  3067. mtlib='$mtlib'
  3068. mansrc='$mansrc'
  3069. manext='$manext'
  3070. maildir='$maildir'
  3071. spool='$spool'
  3072. serverspool='$serverspool'
  3073. active='$active'
  3074. myactive='$myactive'
  3075. activetimes='$activetimes'
  3076. mininact='$mininact'
  3077. pref='$pref'
  3078. defeditor='$defeditor'
  3079. rootid='$rootid'
  3080. mboxchar='$mboxchar'
  3081. locpref='$locpref'
  3082. orgpref='$orgpref'
  3083. citypref='$citypref'
  3084. statepref='$statepref'
  3085. cntrypref='$cntrypref'
  3086. contpref='$contpref'
  3087. strchr='$strchr'
  3088. memcpy='$memcpy'
  3089. rename='$rename'
  3090. ftruncate='$ftruncate'
  3091. usleep='$usleep'
  3092. uselect='$uselect'
  3093. strftime='$strftime'
  3094. xnxlib='$xnxlib'
  3095. chsize='$chsize'
  3096. tzset='$tzset'
  3097. threaddef='$threaddef'
  3098. selectdef='$selectdef'
  3099. threaddir='$threaddir'
  3100. syslog='$syslog'
  3101. novoid='$novoid'
  3102. novfork='$novfork'
  3103. sunos4='$sunos4'
  3104. portable='$portable'
  3105. passnam='$passnam'
  3106. berknam='$berknam'
  3107. usgnam='$usgnam'
  3108. whoami='$whoami'
  3109. termio='$termio'
  3110. termios='$termios'
  3111. fcntl='$fcntl'
  3112. ioctl='$ioctl'
  3113. ptem='$ptem'
  3114. normsig='$normsig'
  3115. sigblock='$sigblock'
  3116. sigret='$sigret'
  3117. sighold='$sighold'
  3118. getuidgid='$getuidgid'
  3119. havetlib='$havetlib'
  3120. getpwent='$getpwent'
  3121. gethostname='$gethostname'
  3122. douname='$douname'
  3123. phostname='$phostname'
  3124. hostcmd='$hostcmd'
  3125. norelay='$norelay'
  3126. rdchk='$rdchk'
  3127. isrrn='$isrrn'
  3128. xthread='$xthread'
  3129. serverfile='$serverfile'
  3130. ignoreorg='$ignoreorg'
  3131. NNTPSRC='$NNTPSRC'
  3132. CONFIG=true
  3133. XEOT
  3134. CONFIG=true
  3135. X$rm -f libc.list .distlist kit*isdone 
  3136. X
  3137. X$echo "If you didn't make any mistakes, then just type a carriage return here."
  3138. X$echo $n "If you need to edit config.sh, do it as a shell escape here: $c"
  3139. X. myread
  3140. case "$ans" in
  3141. X'') ;;
  3142. X*) : in case they cannot read
  3143. X    eval $ans;;
  3144. esac
  3145. X. ./config.sh
  3146. X
  3147. X$echo " "
  3148. X$echo "Doing variable substitutions on various files..."
  3149. X$echo " "
  3150. set `$grep <MANIFEST '\.SH' | awk '{print $1}'`
  3151. for file in $*; do
  3152. X    . $file
  3153. done
  3154. X
  3155. X$echo " "
  3156. X$echo 'Now you need to generate make dependencies by running "makedepend".'
  3157. X$echo 'You might prefer to run it in background: "makedepend > makedepend.out &"'
  3158. X$echo $n "Would you like me to run it for you (it takes quite a while)? [n] $c" 
  3159. X. myread
  3160. case "$ans" in
  3161. y*) ./makedepend;;
  3162. esac
  3163. X$rm -f myread
  3164. X: end of Configure
  3165. END_OF_FILE
  3166. if test 69963 -ne `wc -c <'Configure'`; then
  3167.     echo shar: \"'Configure'\" unpacked with wrong size!
  3168. fi
  3169. chmod +x 'Configure'
  3170. # end of 'Configure'
  3171. fi
  3172. echo shar: End of archive 12 \(of 13\).
  3173. cp /dev/null ark12isdone
  3174. MISSING=""
  3175. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  3176.     if test ! -f ark${I}isdone ; then
  3177.     MISSING="${MISSING} ${I}"
  3178.     fi
  3179. done
  3180. if test "${MISSING}" = "" ; then
  3181.     echo You have unpacked all 13 archives.
  3182.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  3183. else
  3184.     echo You still need to unpack the following archives:
  3185.     echo "        " ${MISSING}
  3186. fi
  3187. ##  End of shell archive.
  3188. exit 0
  3189.